aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index adb8764861c0..8f165b112e03 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -715,13 +715,8 @@ static struct device_node *__of_find_node_by_path(struct device_node *parent,
715{ 715{
716 struct device_node *child; 716 struct device_node *child;
717 int len; 717 int len;
718 const char *end;
719 718
720 end = strchr(path, ':'); 719 len = strcspn(path, "/:");
721 if (!end)
722 end = strchrnul(path, '/');
723
724 len = end - path;
725 if (!len) 720 if (!len)
726 return NULL; 721 return NULL;
727 722
@@ -1893,10 +1888,8 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1893 name = of_get_property(of_chosen, "linux,stdout-path", NULL); 1888 name = of_get_property(of_chosen, "linux,stdout-path", NULL);
1894 if (IS_ENABLED(CONFIG_PPC) && !name) 1889 if (IS_ENABLED(CONFIG_PPC) && !name)
1895 name = of_get_property(of_aliases, "stdout", NULL); 1890 name = of_get_property(of_aliases, "stdout", NULL);
1896 if (name) { 1891 if (name)
1897 of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); 1892 of_stdout = of_find_node_opts_by_path(name, &of_stdout_options);
1898 add_preferred_console("stdout-path", 0, NULL);
1899 }
1900 } 1893 }
1901 1894
1902 if (!of_aliases) 1895 if (!of_aliases)