linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 2/3] [POWERPC][NAND] FSL UPM NAND driver
Date: Sun, 23 Dec 2007 15:02:14 +0300	[thread overview]
Message-ID: <20071223120214.GC5643@zarina> (raw)
In-Reply-To: <20071223133329.9d2c44e4.sfr@canb.auug.org.au>

On Sun, Dec 23, 2007 at 01:33:29PM +1100, Stephen Rothwell wrote:
> On Fri, 21 Dec 2007 23:41:30 +0300 Anton Vorontsov <avorontsov@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?

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: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2

  reply	other threads:[~2007-12-23 12:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 20:35 [PATCH 0/3] fsl upm, nand driver and MPC8360E-RDK as its first user Anton Vorontsov
2007-12-21 20:39 ` [PATCH 1/3] [POWERPC] FSL UPM: routines to manage FSL UPMs Anton Vorontsov
2007-12-21 21:28   ` Olof Johansson
2007-12-23  2:24   ` Stephen Rothwell
2007-12-23 11:59     ` Anton Vorontsov
2007-12-23 12:17       ` Anton Vorontsov
2007-12-23 12:25         ` Anton Vorontsov
2007-12-21 20:41 ` [PATCH 2/3] [POWERPC][NAND] FSL UPM NAND driver Anton Vorontsov
2007-12-23  2:33   ` Stephen Rothwell
2007-12-23 12:02     ` Anton Vorontsov [this message]
2007-12-21 20:41 ` [PATCH 3/3] [POWERPC] MPC8360E-RDK: add support for NAND on UPM Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071223120214.GC5643@zarina \
    --to=cbouatmailru@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).