[PATCH 4/4 v2] powerpc: Katana750i - Add platform support
Stephen Rothwell
sfr at canb.auug.org.au
Thu Jan 17 10:27:02 EST 2008
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.
--
Cheers,
Stephen Rothwell sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080117/148a4be0/attachment.pgp>
More information about the Linuxppc-dev
mailing list