diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-03-07 00:00:30 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-11 08:11:18 +0100 |
commit | 9bb76f450fb773d87c6fef1cab4549046093f3dd (patch) | |
tree | 190043942bf9abbbfdbb01cf2c12c51334dd8ef9 /drivers/usb/storage | |
parent | 14726fa7f3e5c43ed9ca9c9da503be82c2bccd72 (diff) | |
download | barebox-9bb76f450fb773d87c6fef1cab4549046093f3dd.tar.gz barebox-9bb76f450fb773d87c6fef1cab4549046093f3dd.tar.xz |
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 <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/usb.c | 16 |
1 files changed, 4 insertions, 12 deletions
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 */ |