mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name()
@ 2018-06-24 21:29 Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 2/4] commands: mount: " Andrey Smirnov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-06-24 21:29 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 fs/devfs-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/devfs-core.c b/fs/devfs-core.c
index 6b5e6da6a..f017e1c55 100644
--- a/fs/devfs-core.c
+++ b/fs/devfs-core.c
@@ -28,6 +28,7 @@
 #include <linux/fs.h>
 #include <linux/mtd/mtd.h>
 #include <unistd.h>
+#include <fs.h>
 
 LIST_HEAD(cdev_list);
 
@@ -155,10 +156,7 @@ struct cdev *cdev_open(const char *name, unsigned long flags)
 	struct cdev *cdev;
 	int ret;
 
-	if (!strncmp(name, "/dev/", 5))
-		name += 5;
-
-	cdev = cdev_by_name(name);
+	cdev = cdev_by_name(devpath_to_name(name));
 	if (!cdev)
 		return NULL;
 
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] commands: mount: Make use of devpath_to_name()
  2018-06-24 21:29 [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name() Andrey Smirnov
@ 2018-06-24 21:29 ` Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 3/4] commands: mmc_extcsd: " Andrey Smirnov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-06-24 21:29 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] commands: mmc_extcsd: Make use of devpath_to_name()
  2018-06-24 21:29 [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name() Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 2/4] commands: mount: " Andrey Smirnov
@ 2018-06-24 21:29 ` Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 4/4] drivers: of: " Andrey Smirnov
  2018-06-25 20:03 ` [PATCH 1/4] fs: devfs-core: " Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-06-24 21:29 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 commands/mmc_extcsd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 3a418ea5e..889a6c614 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <mci.h>
 #include <getopt.h>
+#include <fs.h>
 
 #define EXT_CSD_BLOCKSIZE	512
 
@@ -2404,10 +2405,8 @@ static int do_mmc_extcsd(int argc, char *argv[])
 		return COMMAND_ERROR_USAGE;
 
 	devname = argv[optind];
-	if (!strncmp(devname, "/dev/", 5))
-		devname += 5;
 
-	mci = mci_get_device_by_name(devname);
+	mci = mci_get_device_by_name(devpath_to_name(devname));
 	if (mci == NULL) {
 		retval = -ENOENT;
 		goto error;
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] drivers: of: Make use of devpath_to_name()
  2018-06-24 21:29 [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name() Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 2/4] commands: mount: " Andrey Smirnov
  2018-06-24 21:29 ` [PATCH 3/4] commands: mmc_extcsd: " Andrey Smirnov
@ 2018-06-24 21:29 ` Andrey Smirnov
  2018-06-25 20:03 ` [PATCH 1/4] fs: devfs-core: " Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-06-24 21:29 UTC (permalink / raw)
  To: barebox; +Cc: Andrey Smirnov

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/of/of_path.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index e53041b0a..f8bbf2cba 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -20,6 +20,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <of.h>
+#include <fs.h>
 
 #include <linux/mtd/mtd.h>
 
@@ -142,10 +143,7 @@ struct device_node *of_find_node_by_devpath(struct device_node *root, const char
 
 	pr_debug("%s: looking for path %s\n", __func__, path);
 
-	if (!strncmp(path, "/dev/", 5))
-		path += 5;
-
-	cdev = cdev_by_name(path);
+	cdev = cdev_by_name(devpath_to_name(path));
 	if (!cdev) {
 		pr_debug("%s: cdev %s not found\n", __func__, path);
 		return NULL;
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name()
  2018-06-24 21:29 [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name() Andrey Smirnov
                   ` (2 preceding siblings ...)
  2018-06-24 21:29 ` [PATCH 4/4] drivers: of: " Andrey Smirnov
@ 2018-06-25 20:03 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2018-06-25 20:03 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Sun, Jun 24, 2018 at 02:29:56PM -0700, Andrey Smirnov wrote:
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>  fs/devfs-core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/fs/devfs-core.c b/fs/devfs-core.c
> index 6b5e6da6a..f017e1c55 100644
> --- a/fs/devfs-core.c
> +++ b/fs/devfs-core.c
> @@ -28,6 +28,7 @@
>  #include <linux/fs.h>
>  #include <linux/mtd/mtd.h>
>  #include <unistd.h>
> +#include <fs.h>
>  
>  LIST_HEAD(cdev_list);
>  
> @@ -155,10 +156,7 @@ struct cdev *cdev_open(const char *name, unsigned long flags)
>  	struct cdev *cdev;
>  	int ret;
>  
> -	if (!strncmp(name, "/dev/", 5))
> -		name += 5;
> -
> -	cdev = cdev_by_name(name);
> +	cdev = cdev_by_name(devpath_to_name(name));
>  	if (!cdev)
>  		return NULL;
>  
> -- 
> 2.17.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-25 20:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-24 21:29 [PATCH 1/4] fs: devfs-core: Make use of devpath_to_name() Andrey Smirnov
2018-06-24 21:29 ` [PATCH 2/4] commands: mount: " Andrey Smirnov
2018-06-24 21:29 ` [PATCH 3/4] commands: mmc_extcsd: " Andrey Smirnov
2018-06-24 21:29 ` [PATCH 4/4] drivers: of: " Andrey Smirnov
2018-06-25 20:03 ` [PATCH 1/4] fs: devfs-core: " Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox