[PATCH 1/2] clk: mxs: get base address from device tree
Shawn Guo
shawn.guo at linaro.org
Tue Mar 26 23:29:14 EDT 2013
On Tue, Mar 26, 2013 at 04:12:35PM +0100, Michał Mirosław wrote:
> 2013/3/26 Shawn Guo <shawn.guo at linaro.org>:
> > Instead of using the static definitions, get clkctrl and digctl base
> > addresses with mapping from device tree.
> >
> > Use macro on variable is not nice, but it's done here to save huge
> > pointless diff stat.
> >
> [...]
> > @@ -100,6 +105,14 @@ int __init mx23_clocks_init(void)
> > struct device_node *np;
> > u32 i;
> >
> > + np = of_find_compatible_node(NULL, NULL, "fsl,imx23-digctl");
> > + digctrl = of_iomap(np, 0);
> > + WARN_ON(!digctrl);
> > +
> > + np = of_find_compatible_node(NULL, NULL, "fsl,imx23-clkctrl");
> > + clkctrl = of_iomap(np, 0);
> > + WARN_ON(!clkctrl);
> > +
>
> WARN? Won't the system die soon anyway if the addresses cannot be found?
Probably. But this big fat warning is also good at telling where goes
wrong at the first place, so I do not see much difference than using BUG.
Shawn
More information about the linux-arm-kernel
mailing list