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 /commands/usb.c | |
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 'commands/usb.c')
-rw-r--r-- | commands/usb.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/commands/usb.c b/commands/usb.c index e5030659b4..9aee4308da 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; } |