From 31879ed96f75e1e75b150e9665e261a44e3fa904 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 19 Jun 2013 23:48:32 +0200 Subject: 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 --- commands/usb.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'commands/usb.c') 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 #include -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; } -- cgit v1.2.3