diff mbox

[U-Boot,5/7] mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data

Message ID 20160615100729.0aa3fbb8@bbrezillon
State Accepted
Commit 30780f948346436f9974fd6eae89aa2eb841b436
Delegated to: Scott Wood
Headers show

Commit Message

Boris Brezillon June 15, 2016, 8:07 a.m. UTC
On Wed, 15 Jun 2016 09:59:15 +0200
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> Hi Scott,
> 
> On Thu, 09 Jun 2016 21:07:00 -0500
> Scott Wood <oss@buserror.net> wrote:
> 
> > On Mon, 2016-06-06 at 18:02 +0200, Boris Brezillon wrote:  
> > > On Mon, 30 May 2016 13:57:56 -0500
> > > Scott Wood <oss@buserror.net> wrote:
> > >     
> > > > These functions are part of the Linux 4.6 sync.  They are being added
> > > > before the main sync patch in order to make it easier to address the
> > > > issue across all NAND drivers (many/most of which do not closely track
> > > > their Linux counterparts) separately from other merge issues.    
> > > 
> > > Some drivers are still directly accessing chip->mtd. Here is a patch
> > > fixing those places [1] (not tested).
> > > 
> > > [1] http://code.bulix.org/inu69a-100476    
> > 
> > Could you send this as a proper patch?  
> 
> Sure, see below. You can squash the changes into you patch (hence the
> !fixup prefix).

Oops, sorry this version was buggy: mtd_to_nand() was called instead of
nand_to_mtd() in a few places. Here is an updated one.

--->8---
From 9c885ff8b3d96f29dfa5ef9850c4519a88a7912d Mon Sep 17 00:00:00 2001
From: Boris Brezillon <boris.brezillon@free-electrons.com>
Date: Wed, 15 Jun 2016 09:48:48 +0200
Subject: [PATCH] fixup! mtd: nand: Add+use mtd_to/from_nand and
 nand_get/set_controller_data

---
 doc/README.nand                     | 2 +-
 drivers/mtd/nand/am335x_spl_bch.c   | 2 +-
 drivers/mtd/nand/atmel_nand.c       | 2 +-
 drivers/mtd/nand/lpc32xx_nand_mlc.c | 2 +-
 drivers/mtd/nand/mxs_nand_spl.c     | 2 +-
 drivers/mtd/nand/nand_spl_simple.c  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

Comments

Crystal Wood June 15, 2016, 5:39 p.m. UTC | #1
On Wed, 2016-06-15 at 10:07 +0200, Boris Brezillon wrote:
> On Wed, 15 Jun 2016 09:59:15 +0200
> Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> 
> > Hi Scott,
> > 
> > On Thu, 09 Jun 2016 21:07:00 -0500
> > Scott Wood <oss@buserror.net> wrote:
> > 
> > > On Mon, 2016-06-06 at 18:02 +0200, Boris Brezillon wrote:  
> > > > On Mon, 30 May 2016 13:57:56 -0500
> > > > Scott Wood <oss@buserror.net> wrote:
> > > >     
> > > > > These functions are part of the Linux 4.6 sync.  They are being
> > > > > added
> > > > > before the main sync patch in order to make it easier to address the
> > > > > issue across all NAND drivers (many/most of which do not closely
> > > > > track
> > > > > their Linux counterparts) separately from other merge issues.    
> > > > 
> > > > Some drivers are still directly accessing chip->mtd. Here is a patch
> > > > fixing those places [1] (not tested).
> > > > 
> > > > [1] http://code.bulix.org/inu69a-100476    ;
> > > 
> > > Could you send this as a proper patch?  
> > 
> > Sure, see below. You can squash the changes into you patch (hence the
> > !fixup prefix).
> 
> Oops, sorry this version was buggy: mtd_to_nand() was called instead of
> nand_to_mtd() in a few places. Here is an updated one.
> 
> --->8---
> From 9c885ff8b3d96f29dfa5ef9850c4519a88a7912d Mon Sep 17 00:00:00 2001
> From: Boris Brezillon <boris.brezillon@free-electrons.com>
> Date: Wed, 15 Jun 2016 09:48:48 +0200
> Subject: [PATCH] fixup! mtd: nand: Add+use mtd_to/from_nand and
>  nand_get/set_controller_data

It's too late to amend the commit.  I need a standalone patch with signoff,
etc.

-Scott
Boris Brezillon June 15, 2016, 6:38 p.m. UTC | #2
On Wed, 15 Jun 2016 12:39:50 -0500
Scott Wood <oss@buserror.net> wrote:

> On Wed, 2016-06-15 at 10:07 +0200, Boris Brezillon wrote:
> > On Wed, 15 Jun 2016 09:59:15 +0200
> > Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> >   
> > > Hi Scott,
> > > 
> > > On Thu, 09 Jun 2016 21:07:00 -0500
> > > Scott Wood <oss@buserror.net> wrote:
> > >   
> > > > On Mon, 2016-06-06 at 18:02 +0200, Boris Brezillon wrote:    
> > > > > On Mon, 30 May 2016 13:57:56 -0500
> > > > > Scott Wood <oss@buserror.net> wrote:
> > > > >       
> > > > > > These functions are part of the Linux 4.6 sync.  They are being
> > > > > > added
> > > > > > before the main sync patch in order to make it easier to address the
> > > > > > issue across all NAND drivers (many/most of which do not closely
> > > > > > track
> > > > > > their Linux counterparts) separately from other merge issues.      
> > > > > 
> > > > > Some drivers are still directly accessing chip->mtd. Here is a patch
> > > > > fixing those places [1] (not tested).
> > > > > 
> > > > > [1] http://code.bulix.org/inu69a-100476    ;  
> > > > 
> > > > Could you send this as a proper patch?    
> > > 
> > > Sure, see below. You can squash the changes into you patch (hence the
> > > !fixup prefix).  
> > 
> > Oops, sorry this version was buggy: mtd_to_nand() was called instead of
> > nand_to_mtd() in a few places. Here is an updated one.
> >   
> > --->8---  
> > From 9c885ff8b3d96f29dfa5ef9850c4519a88a7912d Mon Sep 17 00:00:00 2001
> > From: Boris Brezillon <boris.brezillon@free-electrons.com>
> > Date: Wed, 15 Jun 2016 09:48:48 +0200
> > Subject: [PATCH] fixup! mtd: nand: Add+use mtd_to/from_nand and
> >  nand_get/set_controller_data  
> 
> It's too late to amend the commit.  I need a standalone patch with signoff,
> etc.

Ok, I'll send a standalone patch. BTW, I didn't see any answer
mentioning that you had applied the series to your tree, hence this
fixup patch.
diff mbox

Patch

diff --git a/doc/README.nand b/doc/README.nand
index 96ffc48..ff6fa9b 100644
--- a/doc/README.nand
+++ b/doc/README.nand
@@ -137,7 +137,7 @@  Configuration Options:
       init:
 
 	/* chip is struct nand_chip, and is now provided by the driver. */
-	mtd = &chip.mtd;
+	mtd = nand_to_mtd(&chip);
 
 	/*
 	 * Fill in appropriate values if this driver uses these fields,
diff --git a/drivers/mtd/nand/am335x_spl_bch.c b/drivers/mtd/nand/am335x_spl_bch.c
index 04d5a80..3e63249 100644
--- a/drivers/mtd/nand/am335x_spl_bch.c
+++ b/drivers/mtd/nand/am335x_spl_bch.c
@@ -210,7 +210,7 @@  void nand_init(void)
 	/*
 	 * Init board specific nand support
 	 */
-	mtd = &nand_chip.mtd;
+	mtd = nand_to_mtd(&nand_chip);
 	nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
 		(void  __iomem *)CONFIG_SYS_NAND_BASE;
 	board_nand_init(&nand_chip);
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 75e8307..a66cfc1 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1448,7 +1448,7 @@  int board_nand_init(struct nand_chip *nand)
 
 void nand_init(void)
 {
-	mtd = &nand_chip.mtd;
+	mtd = nand_to_mtd(&nand_chip);
 	mtd->writesize = CONFIG_SYS_NAND_PAGE_SIZE;
 	mtd->oobsize = CONFIG_SYS_NAND_OOBSIZE;
 	nand_chip.IO_ADDR_R = (void __iomem *)CONFIG_SYS_NAND_BASE;
diff --git a/drivers/mtd/nand/lpc32xx_nand_mlc.c b/drivers/mtd/nand/lpc32xx_nand_mlc.c
index 4262029..a793115 100644
--- a/drivers/mtd/nand/lpc32xx_nand_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_nand_mlc.c
@@ -541,7 +541,7 @@  static struct nand_chip lpc32xx_chip;
 
 void board_nand_init(void)
 {
-	struct mtd_info *mtd = &lpc32xx_chip.mtd;
+	struct mtd_info *mtd = nand_to_mtd(&lpc32xx_chip);
 	int ret;
 
 	/* Set all BOARDSPECIFIC (actually core-specific) fields  */
diff --git a/drivers/mtd/nand/mxs_nand_spl.c b/drivers/mtd/nand/mxs_nand_spl.c
index a8a3084..ff28df4 100644
--- a/drivers/mtd/nand/mxs_nand_spl.c
+++ b/drivers/mtd/nand/mxs_nand_spl.c
@@ -147,7 +147,7 @@  static int mxs_nand_init(void)
 
 	/* init mxs nand driver */
 	board_nand_init(&nand_chip);
-	mtd = &nand_chip.mtd;
+	mtd = nand_to_mtd(&nand_chip);
 	/* set mtd functions */
 	nand_chip.cmdfunc = mxs_nand_command;
 	nand_chip.numchips = 1;
diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c
index b023e00..60a7607 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -249,7 +249,7 @@  void nand_init(void)
 	/*
 	 * Init board specific nand support
 	 */
-	mtd = &nand_chip.mtd;
+	mtd = nand_to_mtd(&nand_chip);
 	nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
 		(void  __iomem *)CONFIG_SYS_NAND_BASE;
 	board_nand_init(&nand_chip);