[PATCH 4/4 v2] powerpc: Katana750i - Add platform support
Mark A. Greer
mgreer at mvista.com
Thu Jan 17 11:35:13 EST 2008
On Thu, Jan 17, 2008 at 10:27:02AM +1100, Stephen Rothwell wrote:
> Hi Mark,
>
> On Wed, 16 Jan 2008 15:12:10 -0700 "Mark A. Greer" <mgreer at mvista.com> wrote:
> >
> > +static void __init katana750i_setup_arch(void)
> > +{
> > + struct device_node *np;
> > + phys_addr_t paddr;
> > + const unsigned int *reg;
> > +
> > + np = of_find_compatible_node(NULL, NULL, "katana750i,cpld");
> > + if (!np)
> > + printk(KERN_WARNING "No CPLD DT node; functionality reduced\n");
> > + else {
> > + reg = of_get_property(np, "reg", NULL);
> > + if (!reg)
> > + printk(KERN_WARNING "No CPLD reg property; "
> > + "functionality reduced\n");
> > + else {
> > + paddr = of_translate_address(np, reg);
> > + of_node_put(np);
> > + cpld_base = ioremap(paddr, reg[1]);
> > + }
> > + }
>
> You need an of_node_put(np) for the !reg case above. Maybe you should
> just put it after the else clause instead of in it.
Erg, yes...duh.
Thanks again, Stephen.
Mark
More information about the Linuxppc-dev
mailing list