Instead of looking up the device ourselves let device_detect_by_name do the work. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- commands/detect.c | 5 +---- 1 file changed, 1 insertion(+), 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; } -- 2.1.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox