Skip to content

Commit b3f4ff6

Browse files
VillemoesLi Yang
authored andcommitted
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>
1 parent 6aef512 commit b3f4ff6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/soc/fsl/qe/qe_io.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ int par_io_init(struct device_node *np)
2828
{
2929
struct resource res;
3030
int ret;
31-
const u32 *num_ports;
31+
u32 num_ports;
3232

3333
/* Map Parallel I/O ports registers */
3434
ret = of_address_to_resource(np, 0, &res);
3535
if (ret)
3636
return ret;
3737
par_io = ioremap(res.start, resource_size(&res));
3838

39-
num_ports = of_get_property(np, "num-ports", NULL);
40-
if (num_ports)
41-
num_par_io_ports = *num_ports;
39+
if (!of_property_read_u32(np, "num-ports", &num_ports))
40+
num_par_io_ports = num_ports;
4241

4342
return 0;
4443
}

0 commit comments

Comments
 (0)