[PATCH 4/4] drivers: of: Make use of devpath_to_name()

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

 



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