mtd: nand: add nand_to_mtd() helper
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Tue, 1 Dec 2015 11:03:07 +0000 (12:03 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 8 Dec 2015 20:25:20 +0000 (12:25 -0800)
Add a new helper to retrieve the MTD device attached to a NAND chip.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
include/linux/mtd/nand.h

index d6710575ddb63bffc93bb3fbf60883623df7f236..b614ed2105ac80c0c25908e26fed3d4e22b660ad 100644 (file)
@@ -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
  */