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" <[EMAIL PROTECTED]> 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
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to