[PATCH] pasemi: clean up gpio_mdio init
Olof Johansson
olof at lixom.net
Mon Nov 5 12:10:45 EST 2007
Hi,
On Mon, Nov 05, 2007 at 11:23:07AM +1100, Stephen Rothwell wrote:
> Just a couple of small things ...
Thanks! Unless someone finds something bigger, I'll update this before
I push it out through git, but I won't repost.
> On Sun, 4 Nov 2007 15:37:09 -0600 Olof Johansson <olof at lixom.net> wrote:
> >
> > + ip = of_get_property(phy_dn, "interrupts", NULL);
> > + regp = of_get_property(phy_dn, "reg", NULL);
> > + if (!ip || !regp)
> > + continue;
> > + new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
>
> Paranoid me says to check that *regp is in range.
Yeah, good point.
>
> > int gpio_mdio_init(void)
> > {
> > + struct device_node *np;
> > +
> > + np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
> > + if (!np)
> > + return -ENODEV;
> > + gpio_regs = of_iomap(np, 0);
>
> of_node_put(np); ?
Yup.
Thanks for the review,
-Olof
More information about the Linuxppc-dev
mailing list