[PATCH 1/8] commands: detect: use device_detect_by_name

Sascha Hauer s.hauer at pengutronix.de
Fri Jun 26 00:31:00 PDT 2015


Instead of looking up the device ourselves let device_detect_by_name
do the work.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 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




More information about the barebox mailing list