public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Hauke Mehrtens <hauke@hauke-m.de>
Cc: computersforpeace@gmail.com, linux-mtd@lists.infradead.org,
	David.Woodhouse@intel.com, john@phrozen.org
Subject: Re: [PATCH 5/6] MTD: xway: add missing write_buf and read_buf to nand driver
Date: Tue, 7 Jun 2016 11:34:09 +0200	[thread overview]
Message-ID: <20160607113409.5ef102dd@bbrezillon> (raw)
In-Reply-To: <1465161609-19303-6-git-send-email-hauke@hauke-m.de>

On Sun,  5 Jun 2016 23:20:08 +0200
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> From: John Crispin <john@phrozen.org>
> 
> Signed-off-by: John Crispin <john@phrozen.org>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/mtd/nand/xway_nand.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
> index d44e00d..bc4018e 100644
> --- a/drivers/mtd/nand/xway_nand.c
> +++ b/drivers/mtd/nand/xway_nand.c
> @@ -146,6 +146,32 @@ static unsigned char xway_read_byte(struct mtd_info *mtd)
>  	return ret;
>  }
>  
> +static void xway_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> +{
> +	struct nand_chip *this = mtd->priv;

You should now use mtd_to_nand(). Please rebase your work on top of
nand/next [1], and I'm pretty sure you'll get a NULL pointer.

> +	unsigned long nandaddr = (unsigned long) this->IO_ADDR_R;
> +	unsigned long flags;
> +	int i;
> +
> +	spin_lock_irqsave(&ebu_lock, flags);
> +	for (i = 0; i < len; i++)
> +		buf[i] = ltq_r8((void __iomem *)(nandaddr | NAND_READ_DATA));
> +	spin_unlock_irqrestore(&ebu_lock, flags);
> +}
> +
> +static void xway_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
> +{
> +	struct nand_chip *this = mtd->priv;
> +	unsigned long nandaddr = (unsigned long) this->IO_ADDR_W;
> +	unsigned long flags;
> +	int i;
> +
> +	spin_lock_irqsave(&ebu_lock, flags);
> +	for (i = 0; i < len; i++)
> +		ltq_w8(buf[i], (void __iomem *)(nandaddr | NAND_WRITE_DATA));
> +	spin_unlock_irqrestore(&ebu_lock, flags);
> +}
> +
>  static int xway_nand_probe(struct platform_device *pdev)
>  {
>  	struct nand_chip *this = platform_get_drvdata(pdev);
> @@ -187,6 +213,8 @@ static struct platform_nand_data xway_nand_data = {
>  		.dev_ready	= xway_dev_ready,
>  		.select_chip	= xway_select_chip,
>  		.read_byte	= xway_read_byte,
> +		.read_buf	= xway_read_buf,
> +		.write_buf	= xway_write_buf,
>  	}
>  };
>  

[1]https://github.com/linux-nand/linux/tree/nand/next

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-06-07  9:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-05 21:20 [PATCH 0/6] MTD: xway: updates from OpenWrt/LEDE Hauke Mehrtens
2016-06-05 21:20 ` [PATCH 1/6] MTD: xway: add some more documentation Hauke Mehrtens
2016-06-05 21:20 ` [PATCH 2/6] MTD: xway: fix invalid operator Hauke Mehrtens
2016-06-07  9:28   ` Boris Brezillon
2016-06-07 17:40     ` Hauke Mehrtens
2016-06-07 19:04       ` Boris Brezillon
2016-06-05 21:20 ` [PATCH 3/6] MTD: xway: the latched command should be persistent Hauke Mehrtens
2016-06-07  9:30   ` Boris Brezillon
2016-06-05 21:20 ` [PATCH 4/6] MTD: xway: remove endless loop Hauke Mehrtens
2016-06-05 21:20 ` [PATCH 5/6] MTD: xway: add missing write_buf and read_buf to nand driver Hauke Mehrtens
2016-06-07  9:34   ` Boris Brezillon [this message]
2016-06-05 21:20 ` [PATCH 6/6] MTD: xway: fix nand locking Hauke Mehrtens
2016-06-07  9:24 ` [PATCH 0/6] MTD: xway: updates from OpenWrt/LEDE Boris Brezillon
2016-06-07 17:37   ` Hauke Mehrtens
2016-06-07  9:48 ` Boris Brezillon
2016-06-07 10:12   ` John Crispin
2016-06-07 17:36     ` Hauke Mehrtens
2016-06-07 19:01       ` Boris Brezillon
2016-06-07 19:10         ` Boris Brezillon

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=20160607113409.5ef102dd@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=David.Woodhouse@intel.com \
    --cc=computersforpeace@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=john@phrozen.org \
    --cc=linux-mtd@lists.infradead.org \
    /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