mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 06:33:41 +00:00
35985454a6
Removed because already in upstream: target/linux/bcm53xx/patches-5.10/030-v5.11-0002-ARM-dts-BCM5301X-Harmonize-EHCI-OHCI-DT-nodes-name.patch target/linux/bcm53xx/patches-5.10/033-v5.16-0019-ARM-dts-BCM53573-Describe-on-SoC-BCM53125-rev-4-swit.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0005-ARM-dts-BCM53573-Drop-nonexistent-usb-cells.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch target/linux/bcm53xx/patches-5.10/040-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch All other patches automatically rebased. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
55 lines
1.6 KiB
Diff
55 lines
1.6 KiB
Diff
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/core.c
|
|
+++ b/drivers/mtd/spi-nor/core.c
|
|
@@ -3169,6 +3169,7 @@ int spi_nor_scan(struct spi_nor *nor, co
|
|
struct device *dev = nor->dev;
|
|
struct mtd_info *mtd = &nor->mtd;
|
|
struct device_node *np = spi_nor_get_flash_node(nor);
|
|
+ const char __maybe_unused *of_mtd_name = NULL;
|
|
int ret;
|
|
int i;
|
|
|
|
@@ -3223,7 +3224,12 @@ int spi_nor_scan(struct spi_nor *nor, co
|
|
if (ret)
|
|
return ret;
|
|
|
|
- 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
|
|
@@ -850,6 +850,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;
|