summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>2017-07-23 19:55:48 +0300
committerRob Herring <robh@kernel.org>2017-07-24 09:50:34 -0500
commitb0d9d92f9ce60cd070a62c136914e6fe9d20d49d (patch)
tree685d16995e111791bc62a3272cf8b59d7f57916f /drivers/of
parent8832963d89f09e4cef6c1ec62f0082a545baf69d (diff)
of: base: use of_property_read_string()
of_alias_scan() can use of_property_read_string() -- using the modern DT API adds some prop sanity checks as a bonus; it does add couple LoCs but only because the original code violated the 80-column limit... Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 830f8d2f3594..260d33c0f26c 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1662,11 +1662,13 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
if (of_chosen) {
/* linux,stdout-path and /aliases/stdout are for legacy compatibility */
- const char *name = of_get_property(of_chosen, "stdout-path", NULL);
- if (!name)
- name = of_get_property(of_chosen, "linux,stdout-path", NULL);
+ const char *name = NULL;
+
+ if (of_property_read_string(of_chosen, "stdout-path", &name))
+ of_property_read_string(of_chosen, "linux,stdout-path",
+ &name);
if (IS_ENABLED(CONFIG_PPC) && !name)
- name = of_get_property(of_aliases, "stdout", NULL);
+ of_property_read_string(of_aliases, "stdout", &name);
if (name)
of_stdout = of_find_node_opts_by_path(name, &of_stdout_options);
}