ChangeSet 1.996, 2003/02/04 12:05:32+11:00, [EMAIL PROTECTED]

[PATCH] USB usb-storage: implement device-offline code

This code implements the setting of devices offline during the removal
phase.


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:55 2003
+++ b/drivers/usb/storage/usb.c Tue Feb  4 15:15:55 2003
@@ -941,6 +941,7 @@
 static void storage_disconnect(struct usb_interface *intf)
 {
        struct us_data *ss;
+       struct scsi_device *sdev;
 
        US_DEBUGP("storage_disconnect() called\n");
 
@@ -952,7 +953,11 @@
         */
        BUG_ON(ss == NULL);
 
-       /* TODO: set devices offline -- need host lock for this */
+       /* set devices offline -- need host lock for this */
+       scsi_lock(ss->host);
+       list_for_each_entry(sdev, &ss->host->my_devices, siblings)
+               sdev->online = 0;
+       scsi_unlock(ss->host);
 
        /* lock device access -- no need to unlock, as we're going away */
        down(&(ss->dev_semaphore));



-------------------------------------------------------
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