diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2016-08-09 11:23:32 +0200 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2016-08-13 15:49:35 +0200 |
commit | 0ddae04c226983e1e064d8750b8bb8724f077ad9 (patch) | |
tree | 84f901cf5188629c2bd08d24c9cf743d29f01497 /target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch | |
parent | 86ec4104181992400363e5602c11079e79524d9c (diff) | |
download | mtk-20170518-0ddae04c226983e1e064d8750b8bb8724f077ad9.zip mtk-20170518-0ddae04c226983e1e064d8750b8bb8724f077ad9.tar.gz mtk-20170518-0ddae04c226983e1e064d8750b8bb8724f077ad9.tar.bz2 |
brcm63xx: backport mtd of node changes from upstream
Should fix parser data containing uninitialized values for of probed
physmap flashes, which could break e.g. the redboot parser.
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch')
-rw-r--r-- | target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch new file mode 100644 index 0000000..7b39d4a --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch @@ -0,0 +1,78 @@ +From 28b8b26b308e656edfa9467867d5f79212da2ec3 Mon Sep 17 00:00:00 2001 +From: Brian Norris <computersforpeace@gmail.com> +Date: Fri, 30 Oct 2015 20:33:20 -0700 +Subject: [PATCH] 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> +--- + include/linux/mtd/mtd.h | 11 +++++++++++ + include/linux/mtd/nand.h | 11 +++++++++++ + include/linux/mtd/spi-nor.h | 11 +++++++++++ + 3 files changed, 33 insertions(+) + +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -258,6 +258,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); +--- a/include/linux/mtd/nand.h ++++ b/include/linux/mtd/nand.h +@@ -719,6 +719,17 @@ struct nand_chip { + void *priv; + }; + ++static inline void nand_set_flash_node(struct nand_chip *chip, ++ struct device_node *np) ++{ ++ chip->flash_node = np; ++} ++ ++static inline struct device_node *nand_get_flash_node(struct nand_chip *chip) ++{ ++ return chip->flash_node; ++} ++ + /* + * NAND Flash Manufacturer ID Codes + */ +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -184,6 +184,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 |