[PATCH 2/4] commands: mount: Make use of devpath_to_name()

Andrey Smirnov andrew.smirnov at gmail.com
Sun Jun 24 14:29:57 PDT 2018


Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 commands/mount.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/commands/mount.c b/commands/mount.c
index 4cf1179b7..834b06386 100644
--- a/commands/mount.c
+++ b/commands/mount.c
@@ -76,10 +76,7 @@ static int do_mount(int argc, char *argv[])
 		struct cdev *cdev;
 		const char *path;
 
-		if (!strncmp(devstr, "/dev/", 5))
-			devstr += 5;
-
-		device_detect_by_name(devstr);
+		device_detect_by_name(devpath_to_name(devstr));
 
 		cdev = cdev_by_name(devstr);
 		if (!cdev)
-- 
2.17.1




More information about the barebox mailing list