mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] nand: Add Marvell Orion NAND driver
Date: Tue, 26 Aug 2014 13:06:40 -0300	[thread overview]
Message-ID: <20140826160640.GA8789@arch.cereza> (raw)
In-Reply-To: <20140826142811.GA12155@omega>

On 26 Aug 04:28 PM, Alexander Aring wrote:
> Hi,
> 
> On Sat, Aug 23, 2014 at 05:19:22PM -0300, Ezequiel Garcia wrote:
> > This commit adds NAND support for the controller present in Kirkwood SoCs.
> > 
> 
> cool! I will test it on my DNS-325 platform, if I find some free time.
> 
> Thanks for doing this.
> 
> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> > ---
> >  drivers/mtd/nand/Kconfig      |   7 ++
> >  drivers/mtd/nand/Makefile     |   1 +
> >  drivers/mtd/nand/nand_orion.c | 162 ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 170 insertions(+)
> >  create mode 100644 drivers/mtd/nand/nand_orion.c
> > 
> > diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
> > index 04fe3c8..ccf1f9c 100644
> > --- a/drivers/mtd/nand/Kconfig
> > +++ b/drivers/mtd/nand/Kconfig
> > @@ -90,6 +90,13 @@ config NAND_OMAP_GPMC
> >  	  Support for NAND flash using GPMC. GPMC is a common memory
> >  	  interface found on Texas Instrument's OMAP platforms
> >  
> > +config NAND_ORION
> > +	bool
> > +	prompt "Orion NAND driver"
> > +	depends on ARCH_MVEBU
> > +	help
> > +	  Support for the Orion NAND controller, present in Kirkwood SoCs.
> > +
> >  config NAND_ATMEL
> >  	bool
> >  	prompt "Atmel (AT91SAM9xxx) NAND driver"
> ...
> > +
> > +static int orion_nand_probe(struct device_d *dev)
> > +{
> > +	struct device_node *dev_node = dev->device_node;
> > +	struct orion_nand *priv;
> > +	struct mtd_info *mtd;
> > +	struct nand_chip *chip;
> > +	struct clk *clk;
> > +	void __iomem *io_base;
> > +	int width, ret;
> > +	u32 val = 0;
> > +
> > +	priv = xzalloc(sizeof(struct orion_nand));
> > +	if (!priv) {
> > +		ret = -ENOMEM;
> > +		goto no_res;
> > +	}
> 
> checking on null with xzalloc isn't needed, if fails we run into panic.
> 

Ah, OK.

> > +	mtd = &priv->mtd;
> > +	chip = &priv->chip;
> > +
> > +	io_base = dev_request_mem_region(dev, 0);
> > +
> 
> here we should check the return value. I don't know what's now the
> behaviour on dev_request_mem_region if fail returns NULL or ERR_PTR.
> There was some discussion on the list.
> 

OK, I'll take a look.

-- 
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-08-26 16:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-23 20:19 [PATCH 0/2] mvebu: Openblocks A6 board support Ezequiel Garcia
2014-08-23 20:19 ` [PATCH 1/2] nand: Add Marvell Orion NAND driver Ezequiel Garcia
2014-08-26 14:09   ` Sebastian Hesselbarth
2014-08-26 16:15     ` Ezequiel Garcia
2014-08-26 18:07       ` Sebastian Hesselbarth
2014-08-26 18:36       ` Sebastian Hesselbarth
2014-08-26 14:28   ` Alexander Aring
2014-08-26 16:06     ` Ezequiel Garcia [this message]
2014-09-01  9:33     ` Sascha Hauer
2014-08-23 20:19 ` [PATCH 2/2] ARM: mvebu: Add Plat'home's Kirkwood Openblocks A6 board support Ezequiel Garcia
2014-08-26 14:10   ` Sebastian Hesselbarth
2014-08-26 14:17 ` [PATCH 0/2] mvebu: " Sebastian Hesselbarth
2014-09-01  9:31 ` Sascha Hauer
2014-09-15 19:33 ` Sebastian Hesselbarth

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=20140826160640.GA8789@arch.cereza \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.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