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

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

This code implements the setting of devices offline during the removal
phase.
parent 435c8eb5
...@@ -941,6 +941,7 @@ static int storage_probe(struct usb_interface *intf, ...@@ -941,6 +941,7 @@ static int storage_probe(struct usb_interface *intf,
static void storage_disconnect(struct usb_interface *intf) static void storage_disconnect(struct usb_interface *intf)
{ {
struct us_data *ss; struct us_data *ss;
struct scsi_device *sdev;
US_DEBUGP("storage_disconnect() called\n"); US_DEBUGP("storage_disconnect() called\n");
...@@ -952,7 +953,11 @@ static void storage_disconnect(struct usb_interface *intf) ...@@ -952,7 +953,11 @@ static void storage_disconnect(struct usb_interface *intf)
*/ */
BUG_ON(ss == NULL); 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 */ /* lock device access -- no need to unlock, as we're going away */
down(&(ss->dev_semaphore)); down(&(ss->dev_semaphore));
......
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