diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-19 23:48:32 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-21 07:41:32 +0200 |
commit | 31879ed96f75e1e75b150e9665e261a44e3fa904 (patch) | |
tree | af8486c3b14bad16fb3e183495adb0bf049f2657 /drivers/usb | |
parent | 1e60cbaf6364743d6d47fbd057aec4fa12ff21f4 (diff) | |
download | barebox-31879ed96f75e1e75b150e9665e261a44e3fa904.tar.gz barebox-31879ed96f75e1e75b150e9665e261a44e3fa904.tar.xz |
usb: move scanned status into core
A command should not be interested in the internal USB core state, so
move the state handling into the core.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index e232111410..07175dc3f1 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -488,12 +488,19 @@ static struct usb_device *usb_alloc_new_device(void) return usbdev; } -void usb_rescan(void) +static int scanned; + +void usb_rescan(int force) { struct usb_device *dev, *tmp; struct usb_host *host; int ret; + if (scanned && !force) + return; + + scanned = 1; + list_for_each_entry_safe(dev, tmp, &usb_device_list, list) { list_del(&dev->list); unregister_device(&dev->dev); |