From 39ca74057d186dfd9e12cd7d78d1da4b598c4bc6 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 26 Jun 2015 08:29:57 +0200 Subject: 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 --- commands/detect.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'commands') 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; } -- cgit v1.2.3 From fc34ff801b495bd93e62e4674432b9415f6601d3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 26 Jun 2015 08:59:02 +0200 Subject: commands: mount: detect the device to be mounted Before mounting a device try to detect it. Signed-off-by: Sascha Hauer --- commands/mount.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'commands') diff --git a/commands/mount.c b/commands/mount.c index 939e9bc853..aa769d46fe 100644 --- a/commands/mount.c +++ b/commands/mount.c @@ -79,6 +79,8 @@ static int do_mount(int argc, char *argv[]) if (!strncmp(devstr, "/dev/", 5)) devstr += 5; + device_detect_by_name(devstr); + cdev = cdev_by_name(devstr); if (!cdev) return -ENOENT; -- cgit v1.2.3