aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBoris BREZILLON2015-12-10 09:00:33 +0100
committerBrian Norris2015-12-18 13:19:10 -0800
commit2d3b77bac34bf99d7fdfd712ec2dc4317b3e850b (patch)
tree7ada5ca97a2cfefbe371232bee9decf3ca62448d /include/linux/mtd
parent442f201b93b5222ac2e4f7513be86fdbd00e9065 (diff)
mtd: nand: update mtd_to_nand()
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>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index b614ed2105ac..9cb7ace6fb1f 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -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)