[PATCH v5 41/58] mtd: nand: socrates: use the mtd instance embedded in struct nand_chip

2015-12-11 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes since v4: - fix build error --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __

[PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.

[PATCH v5 15/58] mtd: nand: denali: use the mtd instance embedded in struct nand_chip

2015-12-11 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes since v4: - fix conflict after changes brought in v5 of patch 1 --- Changes generated with the following coccinelle script --->8--

Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
Hi Dinh, On Fri, 11 Dec 2015 10:50:21 -0600 Dinh Nguyen <dinh.li...@gmail.com> wrote: > Hi Boris, > > On Fri, Dec 11, 2015 at 9:10 AM, Boris Brezillon > <boris.brezil...@free-electrons.com> wrote: > > + Dinh (who made commit 2a0a288ec258) > > > > Als

Re: [PATCH v5 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
+ Dinh (who made commit 2a0a288ec258) Also added back the Fixes tag. On Fri, 11 Dec 2015 15:02:34 +0100 Boris Brezillon <boris.brezil...@free-electrons.com> wrote: > Unregister the NAND device from the NAND subsystem when removing a denali > NAND controller, otherwise the

Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
Hi Dan, On Fri, 11 Dec 2015 17:39:47 +0300 Dan Carpenter <dan.carpen...@oracle.com> 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 <computersforpe...@gmail.c

Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
Hi Brian, On Thu, 10 Dec 2015 16:40:08 -0800 Brian Norris <computersforpe...@gmail.com> 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, other

Re: [PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-11 Thread Boris Brezillon
Hi Brian, On Thu, 10 Dec 2015 16:40:08 -0800 Brian Norris <computersforpe...@gmail.com> 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, other

[PATCH v4 28/58] mtd: nand: mxc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 29/58] mtd: nand: nandsim: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nandsim.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drive

[PATCH v4 26/58] mtd: nand: lpc32xx: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 25/58] mtd: nand: jz4740: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 35/58] mtd: nand: plat: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 34/58] mtd: nand: pasemi: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/pasemi_nand.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/pasemi_na

[PATCH v4 36/58] mtd: nand: pxa3xx: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/pxa3xx_nand.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drive

[PATCH v4 33/58] mtd: nand: orion: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- 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/mt

[PATCH v4 16/58] mtd: nand: diskonchip: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/diskonchip.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/diskonch

[PATCH v4 18/58] mtd: nand: fsl_elbc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 13/58] mtd: nand: cs553x: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/cs553x_nand.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/cs553x_na

[PATCH v4 14/58] mtd: nand: davinci: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 45/58] mtd: nand: vf610: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 27/58] mtd: nand: mpc5121: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 10/58] mtd: nand: brcm: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 08/58] mtd: nand: bcm47xx: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 12/58] mtd: nand: cmx270: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/cmx270_nand.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/cmx270_na

[PATCH v4 11/58] mtd: nand: cafe: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/cafe_nand.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/cafe_nand.c b/drive

[PATCH v4 09/58] mtd: nand: bf5xx: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 05/58] mtd: nand: ams-delta: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance instead of allocating our own. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/ams-delta.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/d

[PATCH v4 30/58] mtd: nand: ndfc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 44/58] mtd: nand: txx9ndfmc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 50/58] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Patch generated with the following coccinel

[PATCH v4 49/58] mtd: nand: update mtd_to_nand()

2015-12-10 Thread Boris Brezillon
roller drivers. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- 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/

[PATCH v4 43/58] mtd: nand: tmio: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 47/58] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device, use it instead of allocating a new one. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/s

[PATCH v4 46/58] mtd: nand: update the documentation to reflect framework changes

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Documentation/DocBook/mtdnand.tmp

[PATCH v4 52/58] staging: mt29f_spinand: remove useless mtd->priv = chip assignment

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Patch generated with the following coccinel

[PATCH v4 04/58] mtd: nand: omap2: create and use mtd_to_omap()

2015-12-10 Thread Boris Brezillon
Define and use mtd_to_omap() instead of container_of(); Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/omap2.c | 55 ++-- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/drivers/mtd/nand/o

[PATCH v4 06/58] mtd: nand: atmel: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 00/58] mtd: nand: refactor the NAND subsystem (part 1)

2015-12-10 Thread Boris Brezillon
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: nand

[PATCH v4 02/58] mtd: nand: fsmc: create and use mtd_to_fsmc()

2015-12-10 Thread Boris Brezillon
Create and use mtd_to_fsmc() to avoid duplication of container_of(mtd, struct fsmc_nand_data, mtd) calls. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/fsmc_nand.c | 31 ++- 1 file changed, 14 insertions(+), 17 del

[PATCH v4 01/58] mtd: nand: denali: add missing nand_release() call in denali_remove()

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.

[PATCH v4 03/58] mtd: nand: nuc900: create and use mtd_to_nuc900()

2015-12-10 Thread Boris Brezillon
Create and use mtd_to_nuc900() instead of direct container_of() calls. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nuc900_nand.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/mt

[PATCH v4 07/58] mtd: nand: au1550nd: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 20/58] mtd: nand: fsl_upm: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 56/58] ARM: make use of nand_set/get_controller_data() helpers

2015-12-10 Thread Boris Brezillon
New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- arch/arm/mach-ixp4xx/ixdp425-setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH v4 58/58] staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers

2015-12-10 Thread Boris Brezillon
New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) d

[PATCH v4 51/58] cris: nand: remove useless mtd->priv = chip assignments

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Patch generated with the following coccinel

[PATCH v4 54/58] mtd: nand: kill the chip->flash_node field

2015-12-10 Thread Boris Brezillon
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 <boris.

[PATCH v4 53/58] mtd: nand: simplify nand_dt_init() usage

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.

[PATCH v4 24/58] mtd: nand: hisi504: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 19/58] mtd: nand: fsl_ifc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 55/58] mtd: nand: add helpers to access ->priv

2015-12-10 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- include/linux/mtd/nand.h | 10 ++ 1 file chang

[PATCH v4 40/58] mtd: nand: sharpsl: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 38/58] mtd: nand: s3c2410: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 32/58] mtd: nand: omap2: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 31/58] mtd: nand: nuc900: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 21/58] mtd: nand: fsmc: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 23/58] mtd: nand: gpmi: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 15/58] mtd: nand: denali: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 22/58] mtd: nand: gpio: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- Changes generated with the following coccinelle script --->8--- virtual patch @fix1@ identifier __chipfield, __mtdfield; ty

[PATCH v4 17/58] mtd: nand: docg4: use the mtd instance embedded in struct nand_chip

2015-12-10 Thread Boris Brezillon
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/docg4.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/doc

Re: [PATCH v2 00/25] mtd: nand: refactor the NAND subsystem (part 1)

2015-12-09 Thread Boris Brezillon
Hi Brian, On Tue, 8 Dec 2015 16:36:24 -0800 Brian Norris <computersforpe...@gmail.com> 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

Re: [PATCH v3 bis 12/25] mtd: nand: use the mtd instance embedded in struct nand_chip

2015-12-09 Thread Boris Brezillon
hose 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 independently. T

Re: [linux-sunxi] [PATCH 01/23] mtd: kill the ecclayout->oobavail field

2015-12-08 Thread Boris Brezillon
Hi Priit, On Tue, 08 Dec 2015 08:43:05 +0200 Priit Laes <pl...@plaes.org> wrote: > On Mon, 2015-12-07 at 23:25 +0100, Boris Brezillon wrote: > > ecclayout->oobavail is just redundant with the mtd->oobavail field. > > Moreover, it prevents static const defi

Re: [linux-sunxi] [PATCH 21/23] staging: mt29f_spinand: switch to mtd_ooblayout_ops

2015-12-08 Thread Boris Brezillon
Hi Julian, On Tue, 8 Dec 2015 10:59:53 +1100 Julian Calaby <julian.cal...@gmail.com> wrote: > Hi Boris, > > On Tue, Dec 8, 2015 at 9:26 AM, Boris Brezillon > <boris.brezil...@free-electrons.com> wrote: > > Signed-off-by: Boris Brezillon <boris.brezil...@free-el

Re: [PATCH 05/23] mtd: nand: jz4770: kill the ->ecc_layout field

2015-12-08 Thread Boris Brezillon
On Tue, 8 Dec 2015 10:30:40 + Harvey Hunt <harvey.h...@imgtec.com> wrote: > Hi Boris, > > On 07/12/15 22:26, Boris Brezillon wrote: > > ->ecc_layout is not used by any board file. Kill this field to avoid any > > confusion. New boards are encouraged to use

[PATCH 03/23] mtd: nftl: kill unused oobinfo field

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- include/linux/mtd/nftl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h index b059629..044daa0 100644 --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/

[PATCH 20/23] mtd: onenand: switch to mtd_ooblayout_ops

2015-12-07 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Modify the onenand drivers to switch to this approach. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/onenand/onenand_base.c

[PATCH 21/23] staging: mt29f_spinand: switch to mtd_ooblayout_ops

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 44 --- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_s

[PATCH 23/23] mtd: kill the nand_ecclayout struct

2015-12-07 Thread Boris Brezillon
Now that all mtd drivers have moved to the mtd_ooblayout_ops model we can safely remove the struct nand_ecclayout definition, and all the remaining places where it was still used. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/mtdchar.c

[PATCH 22/23] mtd: nand: kill layout field

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nand_base.c | 8 drivers/mtd/nand/nand_bch.c | 9 - include/linux/mtd/nand.h | 1 - 3 files changed, 18 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mt

[PATCH 18/23] mtd: nand: bch: switch to nand_ecclayout_pos

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nand_bch.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c index 9cff544..2937b49

[PATCH 15/23] mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition

2015-12-07 Thread Boris Brezillon
ted and should be replaced by the equivalent mtd_ooblayout_ops. In the meantime we provide a wrapper around the ->ecclayout field to ease migration to this new model. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/mtdchar.c | 4 ++-- drivers/mtd/mtdc

[PATCH 17/23] mtd: nand: implement the default mtd_ooblayout_ops

2015-12-07 Thread Boris Brezillon
Replace the default nand_ecclayout definitions for large and small page devices with the equivalent mtd_ooblayout_ops. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nand_base.c | 138 +++ include/linux/mtd/

[PATCH 12/23] mtd: use mtd_eccpos() and mtd_oobfree() where appropriate

2015-12-07 Thread Boris Brezillon
The mtd_eccpos(), mtd_oobfree() and mtd_eccbytes() helper functions have been added to avoid direct accesses to the ecclayout, and thus allow for future rework. Use these helpers in all places where the oobfree[] and eccpos[] arrays are referenced. Signed-off-by: Boris Brezillon <boris.bre

[PATCH 16/23] mtd: docg3: switch to mtd_ooblayout_ops

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/devices/docg3.c | 34 +- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 6b516e1..7463dd8

[PATCH 14/23] mtd: use mtd_set_ecclayout() where appropriate

2015-12-07 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/devices/docg3.c| 2 +- drivers/mtd/mtdconcat.c| 2 +- drivers/mtd/mtdpart.c

[PATCH 13/23] mtd: add mtd_set_ecclayout() helper function

2015-12-07 Thread Boris Brezillon
Add an mtd_set_ecclayout() helper function to avoid direct accesses to the mtd->ecclayout field. This will ease future refactor of ECC layout definition. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- include/linux/mtd/mtd.h | 6 ++ 1 file changed, 6 i

[PATCH 11/23] mtd: add mtd_eccpos(), mtd_oobfree() and mtd_eccbytes() helper functions

2015-12-07 Thread Boris Brezillon
In order to make the ecclayout definition completely dynamic we need to rework the way these different ECC layouts are defined and iterated. Create the mtd_eccpos(), mtd_oobfree() and mtd_eccbytes() helpers to hide ecclayout definition internals to their users. Signed-off-by: Boris Brezillon

[PATCH 09/23] mtd: nand: vf610: remove useless mtd->ecclayout assignment

2015-12-07 Thread Boris Brezillon
The NAND core layer is already taking care of ecclayout propagation. Remove this useless assignment. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/vf610_nfc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/nand/vf610_nfc.c b/d

[PATCH 10/23] mtd: nand: simplify nand_bch_init() usage

2015-12-07 Thread Boris Brezillon
. Fallback to eccbytes calculation when it is set to 0. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/nand_base.c | 6 ++ drivers/mtd/nand/nand_bch.c | 27 +-- drivers/mtd/nand/omap2.c | 28 i

[PATCH 08/23] mtd: nand: lpc32xx_mlc: fix ecc.size

2015-12-07 Thread Boris Brezillon
According to the ECC layout description the actual ecc.size is 512 bytes and not mtd->writesize. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/lpc32xx_mlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 01/23] mtd: kill the ecclayout->oobavail field

2015-12-07 Thread Boris Brezillon
ecclayout->oobavail is just redundant with the mtd->oobavail field. Moreover, it prevents static const definition of ecc layouts since the NAND framework is calculating this value based on the ecclayout->oobfree field. Signed-off-by: Boris Brezillon <boris.brezil...@free-e

[PATCH 06/23] mtd: nand: kill unused ->ecclayout field in platform_nand_chip struct

2015-12-07 Thread Boris Brezillon
This field is not set in any board file and can thus be dropped. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/mtd/nand/plat_nand.c | 1 - include/linux/mtd/nand.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/mtd/nand/plat_nand.c b/d

[PATCH 05/23] mtd: nand: jz4770: kill the ->ecc_layout field

2015-12-07 Thread Boris Brezillon
->ecc_layout is not used by any board file. Kill this field to avoid any confusion. New boards are encouraged to use the default ECC layout defined in NAND core. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- arch/mips/include/asm/mach-jz4740/jz4740_n

[PATCH 07/23] staging: mt29f_spinand: kill unused ecclayout field

2015-12-07 Thread Boris Brezillon
The spinand_info struct embeds a pointer to an ecclayout definition, but this field is never used in the mt29f driver. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/staging/mt29f_spinand/mt29f_spinand.h | 1 - 1 file changed, 1 deletion(-) diff --git a/d

[PATCH 04/23] mtd: nand: s3c2410: kill the ->ecc_layout field

2015-12-07 Thread Boris Brezillon
-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- arch/arm/plat-samsung/devs.c | 9 - drivers/mtd/nand/s3c2410.c | 3 --- include/linux/platform_data/mtd-nand-s3c2410.h | 1 - 3 files changed, 13 deletions(-) diff --git a/arch/arm/plat-s

[PATCH 02/23] mtd: inftl: kill unused oobinfo field

2015-12-07 Thread Boris Brezillon
Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- include/linux/mtd/inftl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h index 02cd5f9..8255118 100644 --- a/include/linux/mtd/inftl.h +++ b/include/linux/mtd/i

[PATCH 00/23] mtd: rework ECC layout definition

2015-12-07 Thread Boris Brezillon
river to use this structure. Of course, this step can be delayed if some of the previous patches are not accepted. Best Regards, Boris [1]https://github.com/bbrezillon/linux-sunxi/commits/nand/ecclayout2 Boris Brezillon (23): mtd: kill the ecclayout->oobavail field mtd: inftl: kill unused oobi

[PATCH v3 17/25] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-02 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Patch generated with the following coccinel

Re: [PATCH v2 17/25] mtd: nand: remove useless mtd->priv = chip assignments

2015-12-02 Thread Boris Brezillon
Hi Brian, On Tue, 1 Dec 2015 14:17:47 -0800 Brian Norris <computersforpe...@gmail.com> 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

[PATCH v2 22/25] mtd: nand: add helpers to access ->priv

2015-12-01 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- include/linux/mtd/nand.h | 10 ++ 1 file chang

[PATCH v2 20/25] mtd: nand: simplify nand_dt_init() usage

2015-12-01 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.

[PATCH v2 21/25] mtd: nand: kill the chip->flash_node field

2015-12-01 Thread Boris Brezillon
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 <boris.

[PATCH v2 19/25] staging: mt29f_spinand: remove useless mtd->priv = chip assignment

2015-12-01 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Patch generated with the following coccinel

[PATCH v2 23/25] ARM: make use of nand_set/get_controller_data() helpers

2015-12-01 Thread Boris Brezillon
New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- arch/arm/mach-ixp4xx/ixdp425-setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH v2 15/25] cris: nand: use the mtd instance embedded in struct nand_chip

2015-12-01 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- Most of those changes were gen

[PATCH v2 25/25] staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers

2015-12-01 Thread Boris Brezillon
New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com> --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) d

[PATCH v2 01/25] ARM: nand: make use of mtd_to_nand() where appropriate

2015-12-01 Thread Boris Brezillon
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 <boris.brezil...@free-electrons.com> --- arch/arm/mach-ep93xx/snappercl15.c | 4 ++-- arch/arm/mach-ep93xx

[PATCH v2 00/25] mtd: nand: refactor the NAND subsystem (part 1)

2015-12-01 Thread Boris Brezillon
s 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: ma

  1   2   >