tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe

Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 99fc1d91
...@@ -329,7 +329,7 @@ static void udbg_init_opal_common(void) ...@@ -329,7 +329,7 @@ static void udbg_init_opal_common(void)
void __init hvc_opal_init_early(void) void __init hvc_opal_init_early(void)
{ {
struct device_node *stdout_node = NULL; struct device_node *stdout_node = NULL;
const u32 *termno; const __be32 *termno;
const char *name = NULL; const char *name = NULL;
const struct hv_ops *ops; const struct hv_ops *ops;
u32 index; u32 index;
...@@ -371,7 +371,7 @@ void __init hvc_opal_init_early(void) ...@@ -371,7 +371,7 @@ void __init hvc_opal_init_early(void)
if (!stdout_node) if (!stdout_node)
return; return;
termno = of_get_property(stdout_node, "reg", NULL); termno = of_get_property(stdout_node, "reg", NULL);
index = termno ? *termno : 0; index = termno ? be32_to_cpup(termno) : 0;
if (index >= MAX_NR_HVC_CONSOLES) if (index >= MAX_NR_HVC_CONSOLES)
return; return;
hvc_opal_privs[index] = &hvc_opal_boot_priv; hvc_opal_privs[index] = &hvc_opal_boot_priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment