diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
commit | 85b427ffedfe19f0810808b6739e77be54112170 (patch) | |
tree | 07620b46336fdc6fb6a564a03479197c91f07066 /commands | |
parent | 2720526fa4c0c3b02891a419451b6f1bf8b768a5 (diff) | |
parent | 2177c1c20c83543e559b404208aee21ff4cf037c (diff) | |
download | barebox-85b427ffedfe19f0810808b6739e77be54112170.tar.gz barebox-85b427ffedfe19f0810808b6739e77be54112170.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'commands')
-rw-r--r-- | commands/detect.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/commands/detect.c b/commands/detect.c index 0010a17779..fbce4eb0ce 100644 --- a/commands/detect.c +++ b/commands/detect.c @@ -28,8 +28,9 @@ static int do_detect(int argc, char *argv[]) int opt, i, ret; int option_list = 0; int option_error = 0; + int option_all = 0; - while ((opt = getopt(argc, argv, "el")) > 0) { + while ((opt = getopt(argc, argv, "ela")) > 0) { switch (opt) { case 'l': option_list = 1; @@ -37,6 +38,11 @@ static int do_detect(int argc, char *argv[]) case 'e': option_error = 1; break; + case 'a': + option_all = 1; + break; + default: + return COMMAND_ERROR_USAGE; } } @@ -48,6 +54,15 @@ static int do_detect(int argc, char *argv[]) return 0; } + if (option_all) { + for_each_device(dev) { + ret = device_detect(dev); + if (ret && ret != -ENOSYS && option_error) + return ret; + } + return 0; + } + if (argc == optind) return COMMAND_ERROR_USAGE; |