aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurentiu Tudor <b10716@freescale.com>2014-08-27 10:09:39 -0400
committerGrant Likely <grant.likely@linaro.org>2014-09-08 10:57:26 -0400
commit7dbe5849fb50fc9b5b77a8f590c87a577ddc9bb6 (patch)
tree9671581b49986f4fedaafe72b8ca45c949e7ab54
parentb9c74fd7d231d4086eb6b6af60dccd666cda1288 (diff)
of: make sure of_alias is initialized before accessing it
Simply swap of_alias and of_chosen initialization so that of_alias ends up read first. This must be done because it is accessed couple of lines below when trying to initialize the of_stdout using the alias based legacy method. [Fixes a752ee5 - tty: Update hypervisor tty drivers to use core stdout parsing code] Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com> [glikely: Don't move the 'if (!of_aliases)' test] Signed-off-by: Grant Likely <grant.likely@linaro.org>
-rw-r--r--drivers/of/base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7af64c48ca42..293ed4b687ba 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1859,6 +1859,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1859{ 1859{
1860 struct property *pp; 1860 struct property *pp;
1861 1861
1862 of_aliases = of_find_node_by_path("/aliases");
1862 of_chosen = of_find_node_by_path("/chosen"); 1863 of_chosen = of_find_node_by_path("/chosen");
1863 if (of_chosen == NULL) 1864 if (of_chosen == NULL)
1864 of_chosen = of_find_node_by_path("/chosen@0"); 1865 of_chosen = of_find_node_by_path("/chosen@0");
@@ -1874,7 +1875,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1874 of_stdout = of_find_node_by_path(name); 1875 of_stdout = of_find_node_by_path(name);
1875 } 1876 }
1876 1877
1877 of_aliases = of_find_node_by_path("/aliases");
1878 if (!of_aliases) 1878 if (!of_aliases)
1879 return; 1879 return;
1880 1880