On Sun, Dec 23, 2007 at 01:33:29PM +1100, Stephen Rothwell wrote:
> On Fri, 21 Dec 2007 23:41:30 +0300 Anton Vorontsov <[EMAIL PROTECTED]> wrote:
> >
> > +static int __devinit upm_chip_probe(struct of_device *ofdev,
> > +                               const struct of_device_id *ofid)
> > +{
> > +   struct upm_data *ud;
> > +   struct resource io_res;
> > +   const u32 *prop;
> > +   int ret;
> > +   int size;
> > +
> > +   ud = kzalloc(sizeof(*ud), GFP_KERNEL);
> > +   if (!ud)
> > +           return -ENOMEM;
> > +
> > +   ret = of_address_to_resource(ofdev->node, 0, &io_res);
> > +   if (ret) {
> > +           dev_err(&ofdev->dev, "can't get IO base\n");
> > +           goto err;
> > +   }
> > +
> > +   prop = of_get_property(ofdev->node, "width", &size);
> > +   if (!prop || size != sizeof(u32)) {
> > +           dev_err(&ofdev->dev, "can't get chip width\n");
> > +           goto err;
> 
> Here ret is 0, is that the correct return code?

Nope.

> > +   ud->rnb_gpio = of_get_gpio(ofdev->node, 0);
> > +   if (ud->rnb_gpio >= 0) {
> > +           ret = gpio_request(ud->rnb_gpio, ofdev->dev.bus_id);
> > +           if (ret) {
> > +                   dev_err(&ofdev->dev, "can't request RNB gpio\n");
> > +                   goto err;
> > +           }
> > +           gpio_direction_input(ud->rnb_gpio);
> > +   } else if (ud->rnb_gpio == -EINVAL) {
> > +           dev_err(&ofdev->dev, "specified RNB gpio is invalid\n");
> > +           goto err;
> 
> Again ret is 0 here.

Much thanks for catching that!

-- 
Anton Vorontsov
email: [EMAIL PROTECTED]
backup email: [EMAIL PROTECTED]
irc://irc.freenode.net/bd2
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to