From a4cea873ff85d95c6f184cdef78a5d3ff0af5e1e Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 26 Aug 2019 10:13:52 +0200 Subject: mtd: nand: Add and use static inline wrapper for getting nand_chip from mtd All drivers in tree use mtd->priv for the nand_chip. Add and use a static inline wrapper mtd_to_nand() which we already have in the kernel for getting the nand_chip from the mtd_info struct. Next step would be to embed a struct mtd_info into struct nand_chip. Signed-off-by: Sascha Hauer --- include/linux/mtd/nand.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/mtd/nand.h') diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7f17767c69..576c0c9b10 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -799,4 +799,9 @@ struct nand_sdr_timings { /* get timing characteristics from ONFI timing mode. */ 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; +} + #endif /* __LINUX_MTD_NAND_H */ -- cgit v1.2.3