summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/detect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/commands/detect.c b/commands/detect.c
index d8e0afc314..1586a6fb54 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;
}