From 9bb76f450fb773d87c6fef1cab4549046093f3dd Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 7 Mar 2019 00:00:30 -0800 Subject: usb: Drop usb_disable_asynch() There are no users of usb_control_msg() in the codebase that pass timeout of 0, so it doesn't look like usb_disable_asynch() has any effect on USB operation. Drop that function and remove all of its uses to simplify things. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/usb/storage/usb.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'drivers/usb/storage/usb.c') diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 06ec1eb4e0..b86e72a6fa 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -233,13 +233,10 @@ static int usb_stor_blk_io(int io_op, struct block_device *disk_dev, return -EINVAL; } - usb_disable_asynch(1); - /* ensure unit ready */ dev_dbg(dev, "Testing for unit ready\n"); if (usb_stor_test_unit_ready(pblk_dev)) { dev_dbg(dev, "Device NOT ready\n"); - usb_disable_asynch(0); return -EIO; } @@ -277,8 +274,6 @@ static int usb_stor_blk_io(int io_op, struct block_device *disk_dev, sectors_done += n; } - usb_disable_asynch(0); - dev_dbg(dev, "Successful I/O of %d blocks\n", sectors_done); return (sector_count != 0) ? -EIO : 0; @@ -328,7 +323,6 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev) int result = 0; pblk_dev->blk.num_blocks = 0; - usb_disable_asynch(1); /* get device info */ dev_dbg(dev, "Reading device info\n"); @@ -336,7 +330,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev) result = usb_stor_inquiry(pblk_dev); if (result) { dev_dbg(dev, "Cannot read device info\n"); - goto Exit; + return result; } /* ensure unit ready */ @@ -345,7 +339,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev) result = usb_stor_test_unit_ready(pblk_dev); if (result) { dev_dbg(dev, "Device NOT ready\n"); - goto Exit; + return result; } /* read capacity */ @@ -354,7 +348,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev) result = usb_stor_read_capacity(pblk_dev, &last_lba, &block_length); if (result < 0) { dev_dbg(dev, "Cannot read device capacity\n"); - goto Exit; + return result; } pblk_dev->blk.num_blocks = usb_limit_blk_cnt(last_lba + 1); @@ -364,9 +358,7 @@ static int usb_stor_init_blkdev(struct us_blk_dev *pblk_dev) dev_dbg(dev, "Capacity = 0x%x, blockshift = 0x%x\n", pblk_dev->blk.num_blocks, pblk_dev->blk.blockbits); -Exit: - usb_disable_asynch(0); - return result; + return 0; } /* Create and register a disk device for the specified LUN */ -- cgit v1.2.3