Commit b3f4ff62 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Li Yang

soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init()

This is necessary for this to work on little-endian hosts.
Reviewed-by: default avatarTimur Tabi <timur@kernel.org>
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent 6aef5123
...@@ -28,7 +28,7 @@ int par_io_init(struct device_node *np) ...@@ -28,7 +28,7 @@ int par_io_init(struct device_node *np)
{ {
struct resource res; struct resource res;
int ret; int ret;
const u32 *num_ports; u32 num_ports;
/* Map Parallel I/O ports registers */ /* Map Parallel I/O ports registers */
ret = of_address_to_resource(np, 0, &res); ret = of_address_to_resource(np, 0, &res);
...@@ -36,9 +36,8 @@ int par_io_init(struct device_node *np) ...@@ -36,9 +36,8 @@ int par_io_init(struct device_node *np)
return ret; return ret;
par_io = ioremap(res.start, resource_size(&res)); par_io = ioremap(res.start, resource_size(&res));
num_ports = of_get_property(np, "num-ports", NULL); if (!of_property_read_u32(np, "num-ports", &num_ports))
if (num_ports) num_par_io_ports = num_ports;
num_par_io_ports = *num_ports;
return 0; return 0;
} }
......
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