From: Arnd Bergmann <arnd@arndb.de>
To: cbe-oss-dev@ozlabs.org
Cc: Akinobu Mita <mita@fixstars.com>, linuxppc-dev@ozlabs.org
Subject: Re: [Cbe-oss-dev] [patch 3/5] cell: updated driver for DDR2 memory on AXON
Date: Wed, 20 Jun 2007 01:03:24 +0200 [thread overview]
Message-ID: <200706200103.24799.arnd@arndb.de> (raw)
In-Reply-To: <20070619154812.GA20347@ps3linux.grid.fixstars.com>
On Tuesday 19 June 2007, Akinobu Mita wrote:
> > + if (of_address_to_resource(device->node, 0, &resource) != 0) {
> > + dev_err(&device->dev, "Cannot access device tree\n");
> > + rc = -EFAULT;
> > + goto failed;
> > + }
>
> of_address_to_resource() returns error code on failure:
>
> rc = of_address_to_resource(device->node, 0, &resource);
> if (rc) {
> dev_err(&device->dev, "Cannot access device tree\n");
> goto failed;
> }
>
> is better.
Right.
> > + bank->ph_addr = resource.start;
> > + bank->io_addr = (unsigned long) ioremap_flags(
> > + bank->ph_addr, bank->size, _PAGE_NO_CACHE);
> > + if (bank->io_addr == 0) {
> > + dev_err(&device->dev, "ioremap() failed\n");
> > + rc = -EFAULT;
> > + goto failed;
> > + }
> > +
> > + bank->disk = alloc_disk(AXON_RAM_MINORS_PER_DISK);
> > + if (bank->disk == NULL) {
> > + dev_err(&device->dev, "Cannot register disk\n");
> > + rc = -EFAULT;
> > + goto failed;
> > + }
>
> -ENOMEM is better than -EFAULT. Because alloc_disk() failure happens
> only when it runs out of memory.
yes. EFAULT should only be used when an access to user memory has failed,
so it's wrong practically everywhere in here, your other comments are
obviously correct as well.
Arnd <><
next prev parent reply other threads:[~2007-06-19 23:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-18 22:42 [patch 0/5] cell patches for 2.6.23 Arnd Bergmann
2007-06-18 22:42 ` [patch 1/5] Enable SPU switch notification to detect currently active SPU tasks Arnd Bergmann
2007-06-18 22:42 ` [patch 2/5] Add support to OProfile for profiling Cell/B.E. SPUs Arnd Bergmann
2007-06-20 2:32 ` [Cbe-oss-dev] " mita
2007-06-20 9:35 ` Arnd Bergmann
2007-06-18 22:42 ` [patch 3/5] cell: updated driver for DDR2 memory on AXON Arnd Bergmann
[not found] ` <20070619154812.GA20347@ps3linux.grid.fixstars.com>
2007-06-19 23:03 ` Arnd Bergmann [this message]
2007-06-18 22:42 ` [patch 4/5] cell: saving spus information for kexec crash Arnd Bergmann
2007-06-18 23:58 ` [Cbe-oss-dev] " Michael Ellerman
2007-06-20 18:52 ` André Detsch
2007-06-18 22:42 ` [patch 5/5] Update cell_defconfig Arnd Bergmann
2007-06-18 23:01 ` [Cbe-oss-dev] [patch 0/5] cell patches for 2.6.23 Arnd Bergmann
[not found] <OF39A5D2DB.6FC50A30-ONC1257306.0051B925-C1257306.0052040B@de.ibm.com>
2007-06-26 16:21 ` [Cbe-oss-dev] [patch 3/5] cell: updated driver for DDR2 memory on AXON Arnd Bergmann
2007-06-26 17:53 ` Carsten Otte
2007-06-26 17:38 ` Arnd Bergmann
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=200706200103.24799.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mita@fixstars.com \
/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).