summaryrefslogtreecommitdiff
path: root/include/linux/mtd/spi-nor.h
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-10-30 20:33:20 -0700
committerBrian Norris <computersforpeace@gmail.com>2015-11-11 13:45:05 -0800
commit28b8b26b308e656edfa9467867d5f79212da2ec3 (patch)
treefb42583235108b33d05676b674afd33e74e2a568 /include/linux/mtd/spi-nor.h
parentbf9c37cb627a3f690e246d9326a4a94913771bbf (diff)
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/spi-nor.h')
-rw-r--r--include/linux/mtd/spi-nor.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index c8723b62c4cd..6d991df8f986 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -185,6 +185,17 @@ struct spi_nor {
void *priv;
};
+static inline void spi_nor_set_flash_node(struct spi_nor *nor,
+ struct device_node *np)
+{
+ nor->flash_node = np;
+}
+
+static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
+{
+ return nor->flash_node;
+}
+
/**
* spi_nor_scan() - scan the SPI NOR
* @nor: the spi_nor structure