From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPRA7-0006vs-6G for barebox@lists.infradead.org; Wed, 21 Nov 2018 11:59:20 +0000 From: Sascha Hauer Date: Wed, 21 Nov 2018 12:59:04 +0100 Message-Id: <20181121115904.26371-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] mount command: Fix "mount /dev/" To: Barebox List Cc: Andrey Smirnov We used to put the device name without the "/dev/" component into device_detect_by_name() and cdev_by_name(). Since 8ca7053b3ff we only put the device name into device_detect_by_name(), but cdev_by_name() still gets the full path. The result is that a "mount /dev/" no longer works. Fix this. Fixes: 8ca7053b3ff ("commands: mount: Make use of devpath_to_name()") Signed-off-by: Sascha Hauer Cc: Andrey Smirnov --- commands/mount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/mount.c b/commands/mount.c index 834b06386b..f523f6b3b6 100644 --- a/commands/mount.c +++ b/commands/mount.c @@ -76,7 +76,9 @@ static int do_mount(int argc, char *argv[]) struct cdev *cdev; const char *path; - device_detect_by_name(devpath_to_name(devstr)); + devstr = devpath_to_name(devstr); + + device_detect_by_name(devstr); cdev = cdev_by_name(devstr); if (!cdev) -- 2.19.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox