summaryrefslogtreecommitdiffstats
path: root/commands/usb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-19 23:48:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-21 07:41:32 +0200
commit31879ed96f75e1e75b150e9665e261a44e3fa904 (patch)
treeaf8486c3b14bad16fb3e183495adb0bf049f2657 /commands/usb.c
parent1e60cbaf6364743d6d47fbd057aec4fa12ff21f4 (diff)
downloadbarebox-31879ed96f75e1e75b150e9665e261a44e3fa904.tar.gz
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 'commands/usb.c')
-rw-r--r--commands/usb.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/commands/usb.c b/commands/usb.c
index e503065..9aee430 100644
--- a/commands/usb.c
+++ b/commands/usb.c
@@ -22,24 +22,20 @@
#include <usb/usb.h>
#include <getopt.h>
-static int scanned;
-
static int do_usb(int argc, char *argv[])
{
int opt;
+ int force = 0;
while ((opt = getopt(argc, argv, "f")) > 0) {
switch (opt) {
case 'f':
- scanned = 0;
+ force = 1;
break;
}
}
- if (!scanned) {
- usb_rescan();
- scanned = 1;
- }
+ usb_rescan(force);
return 0;
}