diff options
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 22e48a2b0bd1..e43eddc3d44b 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -233,13 +233,11 @@ static int command_abort(struct scsi_cmnd *srb) | |||
233 | set_bit(US_FLIDX_ABORTING, &us->flags); | 233 | set_bit(US_FLIDX_ABORTING, &us->flags); |
234 | usb_stor_stop_transport(us); | 234 | usb_stor_stop_transport(us); |
235 | } | 235 | } |
236 | scsi_unlock(us_to_host(us)); | ||
237 | 236 | ||
238 | /* Wait for the aborted command to finish */ | 237 | /* Wait for the aborted command to finish */ |
239 | wait_for_completion(&us->notify); | 238 | wait_for_completion(&us->notify); |
240 | 239 | ||
241 | /* Reacquire the lock and allow USB transfers to resume */ | 240 | /* Reacquire the lock and allow USB transfers to resume */ |
242 | scsi_lock(us_to_host(us)); | ||
243 | clear_bit(US_FLIDX_ABORTING, &us->flags); | 241 | clear_bit(US_FLIDX_ABORTING, &us->flags); |
244 | clear_bit(US_FLIDX_TIMED_OUT, &us->flags); | 242 | clear_bit(US_FLIDX_TIMED_OUT, &us->flags); |
245 | return SUCCESS; | 243 | return SUCCESS; |
@@ -255,8 +253,6 @@ static int device_reset(struct scsi_cmnd *srb) | |||
255 | 253 | ||
256 | US_DEBUGP("%s called\n", __FUNCTION__); | 254 | US_DEBUGP("%s called\n", __FUNCTION__); |
257 | 255 | ||
258 | scsi_unlock(us_to_host(us)); | ||
259 | |||
260 | /* lock the device pointers and do the reset */ | 256 | /* lock the device pointers and do the reset */ |
261 | down(&(us->dev_semaphore)); | 257 | down(&(us->dev_semaphore)); |
262 | if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) { | 258 | if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) { |
@@ -266,8 +262,6 @@ static int device_reset(struct scsi_cmnd *srb) | |||
266 | result = us->transport_reset(us); | 262 | result = us->transport_reset(us); |
267 | up(&(us->dev_semaphore)); | 263 | up(&(us->dev_semaphore)); |
268 | 264 | ||
269 | /* lock the host for the return */ | ||
270 | scsi_lock(us_to_host(us)); | ||
271 | return result; | 265 | return result; |
272 | } | 266 | } |
273 | 267 | ||
@@ -282,8 +276,6 @@ static int bus_reset(struct scsi_cmnd *srb) | |||
282 | 276 | ||
283 | US_DEBUGP("%s called\n", __FUNCTION__); | 277 | US_DEBUGP("%s called\n", __FUNCTION__); |
284 | 278 | ||
285 | scsi_unlock(us_to_host(us)); | ||
286 | |||
287 | /* The USB subsystem doesn't handle synchronisation between | 279 | /* The USB subsystem doesn't handle synchronisation between |
288 | * a device's several drivers. Therefore we reset only devices | 280 | * a device's several drivers. Therefore we reset only devices |
289 | * with just one interface, which we of course own. */ | 281 | * with just one interface, which we of course own. */ |
@@ -310,7 +302,6 @@ static int bus_reset(struct scsi_cmnd *srb) | |||
310 | up(&(us->dev_semaphore)); | 302 | up(&(us->dev_semaphore)); |
311 | 303 | ||
312 | /* lock the host for the return */ | 304 | /* lock the host for the return */ |
313 | scsi_lock(us_to_host(us)); | ||
314 | return result < 0 ? FAILED : SUCCESS; | 305 | return result < 0 ? FAILED : SUCCESS; |
315 | } | 306 | } |
316 | 307 | ||
@@ -407,7 +398,7 @@ US_DO_ALL_FLAGS | |||
407 | ***********************************************************************/ | 398 | ***********************************************************************/ |
408 | 399 | ||
409 | /* Output routine for the sysfs max_sectors file */ | 400 | /* Output routine for the sysfs max_sectors file */ |
410 | static ssize_t show_max_sectors(struct device *dev, char *buf) | 401 | static ssize_t show_max_sectors(struct device *dev, struct device_attribute *attr, char *buf) |
411 | { | 402 | { |
412 | struct scsi_device *sdev = to_scsi_device(dev); | 403 | struct scsi_device *sdev = to_scsi_device(dev); |
413 | 404 | ||
@@ -415,7 +406,7 @@ static ssize_t show_max_sectors(struct device *dev, char *buf) | |||
415 | } | 406 | } |
416 | 407 | ||
417 | /* Input routine for the sysfs max_sectors file */ | 408 | /* Input routine for the sysfs max_sectors file */ |
418 | static ssize_t store_max_sectors(struct device *dev, const char *buf, | 409 | static ssize_t store_max_sectors(struct device *dev, struct device_attribute *attr, const char *buf, |
419 | size_t count) | 410 | size_t count) |
420 | { | 411 | { |
421 | struct scsi_device *sdev = to_scsi_device(dev); | 412 | struct scsi_device *sdev = to_scsi_device(dev); |