Re: [PATCH] powerpc/fsl_soc: Search all global-utilities nodes for rstccr
From: Timur Tabi <hidden>
Date: 2010-08-28 22:34:20
[off-list ref] wrote:
+
+ =A0 =A0 =A0 for_each_node_by_name(np, "global-utilities") {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((of_get_property(np, "fsl,has-rstcr", N=ULL))) {+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rstcr =3D of_iomap(np, 0) +=
0xb0;
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!rstcr) + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 printk (KER=
N_EMERG "Error: reset control " I'm not sure KERN_EMERG is warranted for this kind of error.
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 "register not mapped!\n");
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
So if a node has an fsl,rstcr property, but the of_iomap() fails, we jump to the next global-utilities node? Perhaps you need a 'break' after the printk()?
+ =A0 =A0 =A0 } + + =A0 =A0 =A0 if (!rstcr && ppc_md.restart =3D=3D fsl_rstcr_restart)
Wouldn't it make more sense to assign fsl_rstcr_restart to ppc_md.restart only if we find a valid fsl,has-rstcr property? --=20 Timur Tabi Linux kernel developer at Freescale