mtd: nand: embed an mtd_info structure into nand_chip

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:13 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=ed4f85c03cc7460a2f76afb73c22b8894b44ee20
Commit:     ed4f85c03cc7460a2f76afb73c22b8894b44ee20
Parent:     4bd4ebcc540c35d4477b098cf26394f976551464
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Tue Dec 1 12:03:06 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Dec 8 12:25:20 2015 -0800

    mtd: nand: embed an mtd_info structure into nand_chip
    
    Currently all NAND controller drivers are providing both the mtd_info and
    nand_chip struct and then let the NAND subsystem to initialize a few
    things before registering the mtd instance to the MTD layer.
    Embed an mtd_info field into nand_chip to add some consistency to all NAND
    controller drivers.
    This change will also help factorizing boilerplate code copied in all NAND
    drivers.
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 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 fad634e..d671057 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -540,6 +540,7 @@ struct nand_buffers {
 
 /**
  * struct nand_chip - NAND Private Flash Chip Data
+ * @mtd:		MTD device registered to the MTD framework
  * @IO_ADDR_R:		[BOARDSPECIFIC] address to read the 8 I/O lines of the
  *			flash device
  * @IO_ADDR_W:		[BOARDSPECIFIC] address to write the 8 I/O lines of the
@@ -640,6 +641,7 @@ struct nand_buffers {
  */
 
 struct nand_chip {
+	struct mtd_info mtd;
 	void __iomem *IO_ADDR_R;
 	void __iomem *IO_ADDR_W;
 



More information about the linux-mtd-cvs mailing list