lkml.org 
[lkml]   [2015]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 17/27] cris: nand: use the mtd instance embedded in struct nand_chip
Date
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.brezillon@free-electrons.com>
---
Most of those changes were generate with this coccinelle script:
http://code.bulix.org/5vxuih-89429
---
arch/cris/arch-v32/drivers/mach-a3/nandflash.c | 3 +--
arch/cris/arch-v32/drivers/mach-fs/nandflash.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
index db953cf..ad78b97 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
@@ -36,7 +36,6 @@
#define CE_BIT 12

struct mtd_info_wrapper {
- struct mtd_info info;
struct nand_chip chip;
};

@@ -148,7 +147,7 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)

/* Get pointer to private data */
this = &wrapper->chip;
- crisv32_mtd = &wrapper->info;
+ crisv32_mtd = nand_to_mtd(&wrapper->chip);

/* Link the private data with the MTD structure */
crisv32_mtd->priv = this;
diff --git a/arch/cris/arch-v32/drivers/mach-fs/nandflash.c b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
index 22a6467..00a277b 100644
--- a/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
@@ -31,7 +31,6 @@
#define BY_BIT 7

struct mtd_info_wrapper {
- struct mtd_info info;
struct nand_chip chip;
};

@@ -129,7 +128,7 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)

/* Get pointer to private data */
this = &wrapper->chip;
- crisv32_mtd = &wrapper->info;
+ crisv32_mtd = nand_to_mtd(&wrapper->chip);

pa_oe.oe |= 1 << CE_BIT;
pa_oe.oe |= 1 << ALE_BIT;
--
2.1.4


\
 
 \ /
  Last update: 2015-11-16 15:01    [W:0.096 / U:38.344 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site