Commit e5ea5160 authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] USB usb-storage: implement clearing of device queue

This patch clears out the device queue when a unit is removed.
parent 903d3907
...@@ -962,8 +962,12 @@ static void storage_disconnect(struct usb_interface *intf) ...@@ -962,8 +962,12 @@ static void storage_disconnect(struct usb_interface *intf)
/* lock device access -- no need to unlock, as we're going away */ /* lock device access -- no need to unlock, as we're going away */
down(&(ss->dev_semaphore)); down(&(ss->dev_semaphore));
/* TODO: complete all pending commands with /* Complete all pending commands with * cmd->result = DID_ERROR << 16.
* cmd->result = DID_ERROR << 16 */ * Since we only queue one command at a time, this is pretty easy. */
if (ss->srb) {
ss->srb->result = DID_ERROR << 16;
ss->srb->scsi_done(ss->srb);
}
/* TODO: somehow, wait for the device to /* TODO: somehow, wait for the device to
* be 'idle' (tasklet completion) */ * be 'idle' (tasklet completion) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment