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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux