ChangeSet 1.997, 2003/02/04 13:20:08+11:00, [EMAIL PROTECTED]

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

This patch clears out the device queue when a unit is removed.


diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Tue Feb  4 15:15:52 2003
+++ b/drivers/usb/storage/usb.c Tue Feb  4 15:15:52 2003
@@ -962,8 +962,12 @@
        /* lock device access -- no need to unlock, as we're going away */
        down(&(ss->dev_semaphore));
 
-       /* TODO: complete all pending commands with
-        * cmd->result = DID_ERROR << 16 */
+       /* Complete all pending commands with * 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
         * be 'idle' (tasklet completion) */



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to