Hi Brian,
On Thu, 10 Dec 2015 16:40:08 -0800
Brian Norris wrote:
> On Thu, Dec 10, 2015 at 08:59:45AM +0100, Boris Brezillon wrote:
> > Unregister the NAND device from the NAND subsystem when removing a denali
> > NAND controller, otherwise the MTD attached to the NAND
Hi Dinh,
On Fri, 11 Dec 2015 10:50:21 -0600
Dinh Nguyen wrote:
> Hi Boris,
>
> On Fri, Dec 11, 2015 at 9:10 AM, Boris Brezillon
> wrote:
> > + Dinh (who made commit 2a0a288ec258)
> >
> > Also added back the Fixes tag.
> >
> > On Fri, 11 Dec 2015
Hi Dan,
On Fri, 11 Dec 2015 17:39:47 +0300
Dan Carpenter wrote:
> On Fri, Dec 11, 2015 at 02:53:20PM +0100, Boris Brezillon wrote:
> > Hi Brian,
> >
> > On Thu, 10 Dec 2015 16:40:08 -0800
> > Brian Norris wrote:
> >
> > > On Thu, Dec 10, 2015
+ Dinh (who made commit 2a0a288ec258)
Also added back the Fixes tag.
On Fri, 11 Dec 2015 15:02:34 +0100
Boris Brezillon wrote:
> Unregister the NAND device from the NAND subsystem when removing a denali
> NAND controller, otherwise the MTD attached to the NAND device is still
> expos
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes since v4:
- fix conflict after changes brought in v5 of patch 1
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfi
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes since v4:
- fix build error
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __t
Unregister the NAND device from the NAND subsystem when removing a denali
NAND controller, otherwise the MTD attached to the NAND device is still
exposed by the MTD layer, and accesses to this device will likely crash
the system.
Signed-off-by: Boris Brezillon
---
Changes since v4:
- remove Cc
Hi Brian,
On Thu, 10 Dec 2015 16:40:08 -0800
Brian Norris wrote:
> On Thu, Dec 10, 2015 at 08:59:45AM +0100, Boris Brezillon wrote:
> > Unregister the NAND device from the NAND subsystem when removing a denali
> > NAND controller, otherwise the MTD attached to the NAND
Create and use mtd_to_fsmc() to avoid duplication of
container_of(mtd, struct fsmc_nand_data, mtd) calls.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/fsmc_nand.c | 31 ++-
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/drivers/mtd/nand
Create and use mtd_to_nuc900() instead of direct container_of() calls.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/nuc900_nand.c | 25 ++---
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand
struct nand_chip now embeds an mtd device. Make use of this mtd instance
instead of allocating our own.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/ams-delta.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/cs553x_nand.c | 17 -
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/cmx270_nand.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/cafe_nand.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 77c92f1
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/diskonchip.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/docg4.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index da93d7f
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/pxa3xx_nand.c | 33 +
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/pasemi_nand.c | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/r852.c | 34 +++---
drivers/mtd/nand/r852.h | 1 -
2 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/drivers/mtd/nand/r852.c
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
roller drivers.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index b614ed2..9cb7ace 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -734,7
struct nand_chip now embeds an mtd device. Patch all drivers to make use
of this mtd instance instead of using the instance embedded in their
private struct or dynamically allocated.
Signed-off-by: Boris Brezillon
---
Most of those changes were generated with the coccinelle script added
in
The MTD device is now directly embedded in the nand_chip struct. Update the
mtdnand documentation to mention this aspect and fix the different
examples.
Signed-off-by: Boris Brezillon
---
Documentation/DocBook/mtdnand.tmpl | 31 +++
1 file changed, 15 insertions
struct nand_chip now embeds an mtd device, use it instead of allocating
a new one.
Signed-off-by: Boris Brezillon
---
drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c
b/drivers
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
nand_dt_init() function requires 3 arguments where it actually needs one
(dn and mtd can both be retrieved from chip). Drop these parameters.
Testing for dn != NULL inside nand_dt_init() also helps simplifying the
caller code.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/nand_base.c
Now that the nand_chip struct directly embeds an mtd_info struct we can
get rid of the ->flash_node field and forward set/get_flash_node requests
to the MTD layer.
As a side effect, we no longer need the mtd_set_of_node() call done in
nand_dt_init().
Signed-off-by: Boris Brezillon
---
driv
New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.
Signed-off-by: Boris Brezillon
---
drivers/staging/mt29f_spinand/mt29f_spinand.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/mt29f_spin
Add two helpers to access the field reserved for private controller data.
This makes it clearer what this field is reserved for and ease future
refactoring.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/include/linux
New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.
Signed-off-by: Boris Brezillon
---
arch/arm/mach-ixp4xx/ixdp425-setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c
b/arch/arm/m
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/orion_nand.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 4ed4f67..087a040
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/nandsim.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index eb2a567..442eeaf
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
Unregister the NAND device from the NAND subsystem when removing a denali
NAND controller, otherwise the MTD attached to the NAND device is still
exposed by the MTD layer, and accesses to this device will likely crash
the system.
Signed-off-by: Boris Brezillon
Cc: #3.8+
Fixes: 2a0a288ec258
ually fixed some modifications omitted by the coccinelle scripts
- manually reworked modifactions done by coccinelle scripts to improve
readability and fix coding style issues
*** BLURB HERE ***
Boris Brezillon (58):
mtd: nand: denali: add missing nand_release() call in denali_remove()
mtd:
Define and use mtd_to_omap() instead of container_of();
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/omap2.c | 55 ++--
1 file changed, 21 insertions(+), 34 deletions(-)
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index
struct nand_chip now embeds an mtd device. Make use of this mtd instance.
Signed-off-by: Boris Brezillon
---
Changes generated with the following coccinelle script
--->8---
virtual patch
@fix1@
identifier __chipfield, __mtdfield;
type __type;
@@
(
__t
ver those changes one more time, but from my experience, these
kind of bugs are spotted more easily by people who didn't write the
code, so other reviews are more than welcome.
Also, as you suggested, I'll split the changes in several commits (one
per driver) so that you can pick them i
Hi Brian,
On Tue, 8 Dec 2015 16:36:24 -0800
Brian Norris wrote:
> Hi,
>
> On Tue, Dec 01, 2015 at 12:02:57PM +0100, Boris Brezillon wrote:
> > Hello,
> >
> > This huge series aims at clarifying the relationship between the mtd and
> > nand_chip structures an
estions have been made before I started my
nand_controller/nand_chip separation work, and I think we can get
something way simpler if we switch to a model where the core
implements most of the initialization steps (including parsing of
generic DT properties) and ask the controller to do its specific
initial
Hi Brian,
On Tue, 1 Dec 2015 14:17:47 -0800
Brian Norris wrote:
> On Tue, Dec 01, 2015 at 12:03:14PM +0100, Boris Brezillon wrote:
> > mtd_to_nand() now uses the container_of() approach to transform an
> > mtd_info pointer into a nand_chip one. Drop useless mtd->priv
> &g
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
Hi,
On Tue, 1 Dec 2015 12:17:44 +0100 (CET)
Julia Lawall wrote:
>
>
> On Tue, 1 Dec 2015, Boris Brezillon wrote:
>
> > Add nand-priv-no-mtd.cocci to detect and correct NAND controller drivers
> > directly embedding an mtd_info struct in their private struct.
>
ons done by coccinelle scripts to improve
readability and fix coding style issues
Boris Brezillon (25):
ARM: nand: make use of mtd_to_nand() where appropriate
blackfin: nand: make use of mtd_to_nand() where appropriate
cris: nand: make use of mtd_to_nand() where appropriate
mips: nand:
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all SH specific implementations to use this
helper.
Signed-off-by: Boris Brezillon
---
arch/sh/boards/mach-migor/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all blackfin specific implementations to use
this helper.
Signed-off-by: Boris Brezillon
---
arch/blackfin/mach-bf537/boards/stamp.c | 2 +-
arch/blackfin/mach-bf561/boards/acvilon.c | 2 +-
2 fi
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all ARM specific implementations to use this
helper.
Signed-off-by: Boris Brezillon
---
arch/arm/mach-ep93xx/snappercl15.c | 4 ++--
arch/arm/mach-ep93xx/ts72xx.c| 4 ++--
arch/arm/mach-
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all CRIS specific implementations to use this
helper.
Signed-off-by: Boris Brezillon
---
arch/cris/arch-v32/drivers/mach-a3/nandflash.c | 2 +-
arch/cris/arch-v32/drivers/mach-fs/nandflash.c | 2 +-
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all MIPS specific implementations to use this
helper.
Signed-off-by: Boris Brezillon
---
arch/mips/alchemy/devboards/db1200.c | 2 +-
arch/mips/alchemy/devboards/db1300.c | 2 +-
arch/mips/alch
struct nand_chip now embeds an mtd device, use it instead of allocating
a new one.
Signed-off-by: Boris Brezillon
---
drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c
b/drivers
Add nand-priv-no-mtd.cocci to detect and correct NAND controller drivers
directly embedding an mtd_info struct in their private struct.
Signed-off-by: Boris Brezillon
Cc: Julia Lawall
---
Hi Julia,
Not sure this is the correct way to detect and fix offending drivers,
but I get some warnings
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Use it where appropriate.
Signed-off-by: Boris Brezillon
---
drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/mt29f_spin
mtd_to_nand() was recently introduced to avoid direct access to the
mtd->priv field. Update core code to use mtd_to_nand().
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/nand_base.c | 84 ++--
drivers/mtd/nand/nand_bbt.c |
Add a new helper to retrieve the MTD device attached to a NAND chip.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c4e39ff..8ec071e 100644
--- a/include/linux/mtd
.
This change will also help factorizing boilerplate code copied in all NAND
drivers.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 056d165..c4e39ff 100644
--- a/include
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
The MTD device is now directly embedded in the nand_chip struct. Update the
mtdnand documentation to mention this aspect and fix the different
examples.
Signed-off-by: Boris Brezillon
---
Documentation/DocBook/mtdnand.tmpl | 31 +++
1 file changed, 15 insertions
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
struct nand_chip now embeds an mtd device. Patch all drivers to make use
of this mtd instance instead of using the instance embedded in their
private struct or dynamically allocated.
Signed-off-by: Boris Brezillon
---
Most of those changes were generated with the coccinelle script added
in
mtd_to_nand() now uses the container_of() approach to transform an
mtd_info pointer into a nand_chip one. Drop useless mtd->priv
assignments from NAND controller drivers.
Signed-off-by: Boris Brezillon
---
Patch generated with the following coccinelle script:
---8<
virtual patch
@@
New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.
Signed-off-by: Boris Brezillon
---
arch/arm/mach-ixp4xx/ixdp425-setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c
b/arch/arm/m
New helpers have been added to avoid directly accessing chip->field. Use
them where appropriate.
Signed-off-by: Boris Brezillon
---
drivers/staging/mt29f_spinand/mt29f_spinand.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/mt29f_spin
nand_dt_init() function requires 3 arguments where it actually needs one
(dn and mtd can both be retrieved from chip). Drop these parameters.
Testing for dn != NULL inside nand_dt_init() also helps simplifying the
caller code.
Signed-off-by: Boris Brezillon
---
drivers/mtd/nand/nand_base.c
Now that the nand_chip struct directly embeds an mtd_info struct we can
get rid of the ->flash_node field and forward set/get_flash_node requests
to the MTD layer.
As a side effect, we no longer need the mtd_set_of_node() call done in
nand_dt_init().
Signed-off-by: Boris Brezillon
---
driv
roller drivers.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8ec071e..873646d 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -734,7
Add two helpers to access the field reserved for private controller data.
This makes it clearer what this field is reserved for and ease future
refactoring.
Signed-off-by: Boris Brezillon
---
include/linux/mtd/nand.h | 10 ++
1 file changed, 10 insertions(+)
diff --git a/include/linux
de blocks (loop or
conditional statements).
And, as you stated, we might want to keep direct calls to nand_to_mtd()
if it's only called once in a function context.
I'm pretty sure we could describe all those cases with specific context
description, but I must admit that it takes less time f
Hi Brian,
On Mon, 16 Nov 2015 19:00:19 -0800
Brian Norris wrote:
> Hi Boris,
>
> On Mon, Nov 16, 2015 at 02:37:47PM +0100, Boris Brezillon wrote:
> > struct nand_chip now embeds an mtd device. Patch all drivers to make use
> > of this mtd instance instead of using the
On Mon, 16 Nov 2015 19:03:53 -0800
Brian Norris wrote:
> On Mon, Nov 16, 2015 at 02:37:51PM +0100, Boris Brezillon wrote:
> > Now that all drivers are using the mtd instance embedded in the nand_chip
>
> Do you have a script that verifies this? I thought you did at some
>
mtd_to_nand() was recently introduced to avoid direct accesses to the
mtd->priv field. Update all ARM specific implementations to use this
helper.
Signed-off-by: Boris Brezillon
---
arch/arm/mach-ep93xx/snappercl15.c | 4 ++--
arch/arm/mach-ep93xx/ts72xx.c| 4 ++--
arch/arm/mach-
wo concepts, and getting
rid of more boilerplate code in NAND controller drivers.
Stay tuned ;-).
Best Regards,
Boris
Boris Brezillon (27):
mtd: nand: fix drivers abusing mtd->priv
mtd: nand: add an mtd_to_nand() helper
mtd: nand: update examples in the documentation to use mtd_to_nand
1 - 100 of 142 matches
Mail list logo