mtd: nand: add nand_to_mtd() helper

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=ffd014f43fdcb6edb5a7f302de1e717e8c0673d5
Commit:     ffd014f43fdcb6edb5a7f302de1e717e8c0673d5
Parent:     ed4f85c03cc7460a2f76afb73c22b8894b44ee20
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Tue Dec 1 12:03:07 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Tue Dec 8 12:25:20 2015 -0800

    mtd: nand: add nand_to_mtd() helper
    
    Add a new helper to retrieve the MTD device attached to a NAND chip.
    
    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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index d671057..b614ed2 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -737,6 +737,11 @@ static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
 	return mtd->priv;
 }
 
+static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)
+{
+	return &chip->mtd;
+}
+
 /*
  * NAND Flash Manufacturer ID Codes
  */



More information about the linux-mtd-cvs mailing list