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? > + 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. -- Cheers, Stephen Rothwell [EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/
pgp5WbcxRuGTQ.pgp
Description: PGP signature
_______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev