diff options
| author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2015-11-16 08:37:35 -0500 |
|---|---|---|
| committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-19 14:09:10 -0500 |
| commit | 9eba47ddd8fee8a21f45e6e1d707103f040d90c7 (patch) | |
| tree | 7bf16fea722d3dacc27108df792ce6920aa12487 /include | |
| parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
mtd: nand: add an mtd_to_nand() helper
Some drivers are retrieving the nand_chip pointer using the container_of
macro on a struct wrapping both the nand_chip and the mtd_info struct while
the standard way of retrieving this pointer is through mtd->priv.
Provide an helper to do that.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include')
| -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 5a9d1d4c2487..a4839b3f27da 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -719,6 +719,11 @@ struct nand_chip { | |||
| 719 | void *priv; | 719 | void *priv; |
| 720 | }; | 720 | }; |
| 721 | 721 | ||
| 722 | static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd) | ||
| 723 | { | ||
| 724 | return mtd->priv; | ||
| 725 | } | ||
| 726 | |||
| 722 | /* | 727 | /* |
| 723 | * NAND Flash Manufacturer ID Codes | 728 | * NAND Flash Manufacturer ID Codes |
| 724 | */ | 729 | */ |
