diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-10-31 06:33:20 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-12 00:45:05 +0300 |
commit | 28b8b26b308e656edfa9467867d5f79212da2ec3 (patch) | |
tree | fb42583235108b33d05676b674afd33e74e2a568 /include/linux/mtd/mtd.h | |
parent | bf9c37cb627a3f690e246d9326a4a94913771bbf (diff) | |
download | linux-28b8b26b308e656edfa9467867d5f79212da2ec3.tar.xz |
mtd: add get/set of_node/flash_node helpers
We are going to begin using the mtd->dev.of_node field for MTD device
nodes, so let's add helpers for it. Also, we'll be making some
conversions on spi_nor (and nand_chip eventually) too, so get that ready
with their own helpers.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r-- | include/linux/mtd/mtd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index f17fa75809aa..cc84923011c0 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -254,6 +254,17 @@ struct mtd_info { int usecount; }; +static inline void mtd_set_of_node(struct mtd_info *mtd, + struct device_node *np) +{ + mtd->dev.of_node = np; +} + +static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd) +{ + return mtd->dev.of_node; +} + int mtd_erase(struct mtd_info *mtd, struct erase_info *instr); int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, void **virt, resource_size_t *phys); |