]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mtd: nand: update mtd_to_nand()
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Thu, 10 Dec 2015 08:00:33 +0000 (09:00 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Fri, 18 Dec 2015 21:19:10 +0000 (13:19 -0800)
Now that all drivers are using the mtd instance embedded in the nand_chip
struct we can safely update the mtd_to_nand() implementation to use
the container_of macro instead of returning the content of mtd->priv.
This will allow us to remove mtd->priv = chip assignments done in all
NAND controller drivers.

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

index b614ed2105ac80c0c25908e26fed3d4e22b660ad..9cb7ace6fb1f5047e7e53101d4c97dd4f170ccc8 100644 (file)
@@ -734,7 +734,7 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
 
 static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
 {
-       return mtd->priv;
+       return container_of(mtd, struct nand_chip, mtd);
 }
 
 static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)