From fd72834fa74b604efc7b2af5f40ccab5796b79e7 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 12 Sep 2019 11:14:21 +0200 Subject: mtd: nand: Fix retrieving nand_chip from mtd_info With 76b6f74c53 we begin embedding a struct mtd_info into struct nand_chip. With this mtd_to_nand() must be changed accordingly. Fixes: 76b6f74c53 ("mtd: nand: Embed struct mtd_info into struct nand_chip") Signed-off-by: Sascha Hauer --- include/linux/mtd/nand.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 762f9c4f2a..401f630570 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -803,7 +803,7 @@ const struct nand_sdr_timings *onfi_async_timing_mode_to_sdr_timings(int mode); static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd) { - return mtd->priv; + return container_of(mtd, struct nand_chip, mtd); } #endif /* __LINUX_MTD_NAND_H */ -- cgit v1.2.3