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: Timur Tabi <timur@kernel.org> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Li Yang <leoyang.li@nxp.com>
This commit is contained in:
committed by
Li Yang
parent
6aef512387
commit
b3f4ff62f6
@ -28,7 +28,7 @@ int par_io_init(struct device_node *np)
|
||||
{
|
||||
struct resource res;
|
||||
int ret;
|
||||
const u32 *num_ports;
|
||||
u32 num_ports;
|
||||
|
||||
/* Map Parallel I/O ports registers */
|
||||
ret = of_address_to_resource(np, 0, &res);
|
||||
@ -36,9 +36,8 @@ int par_io_init(struct device_node *np)
|
||||
return ret;
|
||||
par_io = ioremap(res.start, resource_size(&res));
|
||||
|
||||
num_ports = of_get_property(np, "num-ports", NULL);
|
||||
if (num_ports)
|
||||
num_par_io_ports = *num_ports;
|
||||
if (!of_property_read_u32(np, "num-ports", &num_ports))
|
||||
num_par_io_ports = num_ports;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user