All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	linux-mtd@lists.infradead.org,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-sunxi@googlegroups.com,
	linux-arm-kernel@lists.infradead.org, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH v3] mtd: nand: sunxi: rely on nand_dt_init initialization
Date: Fri, 11 Sep 2015 15:53:40 -0700	[thread overview]
Message-ID: <20150911225340.GI11487@google.com> (raw)
In-Reply-To: <1441182625-525-1-git-send-email-boris.brezillon@free-electrons.com>

On Wed, Sep 02, 2015 at 10:30:25AM +0200, Boris Brezillon wrote:
> nand_dt_init(), called from nand_scan_ident(), is already parsing the
> generic MTD/NAND DT properties, and initializing the nand_chip struct
> accordingly.
> Rely on this initialization instead of manually parsing those properties.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
> Changes since v2:
> - fix a bug forcing ecc.mode to HW_ECC
> Changes since v1:
> - drop unused strength and blk_size variables
> ---
>  drivers/mtd/nand/sunxi_nand.c | 27 ++++++++++-----------------
>  1 file changed, 10 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index 0c29f6c..d644548 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
[...]
> @@ -1224,15 +1211,18 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
>  	/* Default tR value specified in the ONFI spec (chapter 4.15.1) */
>  	nand->chip_delay = 200;
>  	nand->controller = &nfc->controller;
> +	/*
> +	 * Set the ECC mode to the default value in case nothing is specified
> +	 * in the DT.
> +	 */
> +	nand->ecc.mode = NAND_ECC_HW;
> +	nand->dn = np;

Renamed dn -> flash_node, due to [1], and applied to l2-mtd.git/next

>  	nand->select_chip = sunxi_nfc_select_chip;
>  	nand->cmd_ctrl = sunxi_nfc_cmd_ctrl;
>  	nand->read_buf = sunxi_nfc_read_buf;
>  	nand->write_buf = sunxi_nfc_write_buf;
>  	nand->read_byte = sunxi_nfc_read_byte;
>  
> -	if (of_get_nand_on_flash_bbt(np))
> -		nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
> -
>  	mtd = &chip->mtd;
>  	mtd->dev.parent = dev;
>  	mtd->priv = nand;

Brian

[1] http://patchwork.ozlabs.org/patch/514205/

WARNING: multiple messages have this Message-ID (diff)
From: computersforpeace@gmail.com (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] mtd: nand: sunxi: rely on nand_dt_init initialization
Date: Fri, 11 Sep 2015 15:53:40 -0700	[thread overview]
Message-ID: <20150911225340.GI11487@google.com> (raw)
In-Reply-To: <1441182625-525-1-git-send-email-boris.brezillon@free-electrons.com>

On Wed, Sep 02, 2015 at 10:30:25AM +0200, Boris Brezillon wrote:
> nand_dt_init(), called from nand_scan_ident(), is already parsing the
> generic MTD/NAND DT properties, and initializing the nand_chip struct
> accordingly.
> Rely on this initialization instead of manually parsing those properties.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
> Changes since v2:
> - fix a bug forcing ecc.mode to HW_ECC
> Changes since v1:
> - drop unused strength and blk_size variables
> ---
>  drivers/mtd/nand/sunxi_nand.c | 27 ++++++++++-----------------
>  1 file changed, 10 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
> index 0c29f6c..d644548 100644
> --- a/drivers/mtd/nand/sunxi_nand.c
> +++ b/drivers/mtd/nand/sunxi_nand.c
[...]
> @@ -1224,15 +1211,18 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
>  	/* Default tR value specified in the ONFI spec (chapter 4.15.1) */
>  	nand->chip_delay = 200;
>  	nand->controller = &nfc->controller;
> +	/*
> +	 * Set the ECC mode to the default value in case nothing is specified
> +	 * in the DT.
> +	 */
> +	nand->ecc.mode = NAND_ECC_HW;
> +	nand->dn = np;

Renamed dn -> flash_node, due to [1], and applied to l2-mtd.git/next

>  	nand->select_chip = sunxi_nfc_select_chip;
>  	nand->cmd_ctrl = sunxi_nfc_cmd_ctrl;
>  	nand->read_buf = sunxi_nfc_read_buf;
>  	nand->write_buf = sunxi_nfc_write_buf;
>  	nand->read_byte = sunxi_nfc_read_byte;
>  
> -	if (of_get_nand_on_flash_bbt(np))
> -		nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
> -
>  	mtd = &chip->mtd;
>  	mtd->dev.parent = dev;
>  	mtd->priv = nand;

Brian

[1] http://patchwork.ozlabs.org/patch/514205/

  reply	other threads:[~2015-09-11 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02  8:30 [PATCH v3] mtd: nand: sunxi: rely on nand_dt_init initialization Boris Brezillon
2015-09-02  8:30 ` Boris Brezillon
2015-09-11 22:53 ` Brian Norris [this message]
2015-09-11 22:53   ` Brian Norris

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=20150911225340.GI11487@google.com \
    --to=computersforpeace@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=marex@denx.de \
    --cc=maxime.ripard@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.