diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-26 10:13:52 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-08-26 10:13:56 +0200 |
commit | a4cea873ff85d95c6f184cdef78a5d3ff0af5e1e (patch) | |
tree | eebd588b1c76d560bd770e77f4dc501f81de168c /include/linux/mtd/nand.h | |
parent | 7536df20a8aefb35b83aebdb5eac636ef1df75fd (diff) | |
download | barebox-a4cea873ff85d95c6f184cdef78a5d3ff0af5e1e.tar.gz barebox-a4cea873ff85d95c6f184cdef78a5d3ff0af5e1e.tar.xz |
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 <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r-- | include/linux/mtd/nand.h | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |