diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2021-10-24 20:31:08 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2021-11-02 23:37:19 +0100 |
commit | 9b96fcf9f6369982668d1d4cf68dca9453d28a56 (patch) | |
tree | 845e3129675b6eeb860e33edf1d47d4482731b6a /target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch | |
parent | 6e5ab1b154854e379f20fa6ed64cf4b656c985e7 (diff) | |
download | upstream-9b96fcf9f6369982668d1d4cf68dca9453d28a56.tar.gz upstream-9b96fcf9f6369982668d1d4cf68dca9453d28a56.tar.bz2 upstream-9b96fcf9f6369982668d1d4cf68dca9453d28a56.zip |
pistachio: Copy kernel 5.4 patches to 5.10
This just copies the patches and the configuration from kernel 5.4 to
kernel 5.10.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch')
-rw-r--r-- | target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch new file mode 100644 index 0000000000..69a8303d2b --- /dev/null +++ b/target/linux/pistachio/patches-5.10/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -0,0 +1,54 @@ +From f32bc2aa01edcba2f2ed5db151cf183eac9ef919 Mon Sep 17 00:00:00 2001 +From: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com> +Date: Sat, 25 Feb 2017 16:42:50 +0000 +Subject: mtd: nor: support mtd name from device tree + +Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com> +--- + drivers/mtd/spi-nor/spi-nor.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -4938,6 +4938,7 @@ int spi_nor_scan(struct spi_nor *nor, co + struct mtd_info *mtd = &nor->mtd; + struct device_node *np = spi_nor_get_flash_node(nor); + struct spi_nor_flash_parameter *params = &nor->params; ++ const char __maybe_unused *of_mtd_name = NULL; + int ret; + int i; + +@@ -5000,7 +5001,12 @@ int spi_nor_scan(struct spi_nor *nor, co + /* Init flash parameters based on flash_info struct and SFDP */ + spi_nor_init_params(nor); + +- if (!mtd->name) ++#ifdef CONFIG_MTD_OF_PARTS ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++#endif ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ else if (!mtd->name) + mtd->name = dev_name(dev); + mtd->priv = nor; + mtd->type = MTD_NORFLASH; +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -779,6 +779,17 @@ out_error: + */ + static void mtd_set_dev_defaults(struct mtd_info *mtd) + { ++#ifdef CONFIG_MTD_OF_PARTS ++ const char __maybe_unused *of_mtd_name = NULL; ++ struct device_node *np; ++ ++ np = mtd_get_of_node(mtd); ++ if (np && !mtd->name) { ++ of_property_read_string(np, "linux,mtd-name", &of_mtd_name); ++ if (of_mtd_name) ++ mtd->name = of_mtd_name; ++ } else ++#endif + if (mtd->dev.parent) { + if (!mtd->owner && mtd->dev.parent->driver) + mtd->owner = mtd->dev.parent->driver->owner; |