summaryrefslogtreecommitdiffstats
path: root/commands/detect.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-06-26 08:29:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-06-26 09:19:35 +0200
commit39ca74057d186dfd9e12cd7d78d1da4b598c4bc6 (patch)
treeef2da9ef4860969a959f3f2cbf37ffc65b360555 /commands/detect.c
parentb22d27436bfb5dccdca87c8f0143bfdc831cb336 (diff)
downloadbarebox-39ca74057d186dfd9e12cd7d78d1da4b598c4bc6.tar.gz
commands: detect: use device_detect_by_name
Instead of looking up the device ourselves let device_detect_by_name do the work. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/detect.c')
-rw-r--r--commands/detect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/commands/detect.c b/commands/detect.c
index d8e0afc..1586a6f 100644
--- a/commands/detect.c
+++ b/commands/detect.c
@@ -68,10 +68,7 @@ static int do_detect(int argc, char *argv[])
return COMMAND_ERROR_USAGE;
for (i = optind; i < argc; i++) {
- dev = get_device_by_name(argv[i]);
- if (!dev)
- return -ENODEV;
- ret = device_detect(dev);
+ ret = device_detect_by_name(argv[i]);
if (ret && option_error)
return ret;
}