[PATCH 2/3] [POWERPC][NAND] FSL UPM NAND driver

Stephen Rothwell sfr at canb.auug.org.au
Sat Dec 22 21:33:29 EST 2007


On Fri, 21 Dec 2007 23:41:30 +0300 Anton Vorontsov <avorontsov at ru.mvista.com> 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                    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.infradead.org/pipermail/linux-mtd/attachments/20071223/3071fbe0/attachment.bin 


More information about the linux-mtd mailing list