mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 00:41:17 +00:00
aa0aa47aa1
Newer batches of several Mikrotik boards contain this yet-unsupported flash chip, for instance: - rb941-2nd (hAP lite) - rb952ui-5ac2nd (hAP ac lite) - RBM33G and probably other Mikrotik boards need this patch as well. The patch was submitted upstream by Robert Marko: https://patchwork.ozlabs.org/patch/934181/ Closes: FS#1715 Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org> Cc: Robert Marko <robimarko@gmail.com> [Rebased + refreshed on current kernels] Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
35 lines
1.1 KiB
Diff
35 lines
1.1 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/spi-nor.c
|
|
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
|
@@ -2661,6 +2661,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;
|
|
|
|
@@ -2736,7 +2737,12 @@ int spi_nor_scan(struct spi_nor *nor, co
|
|
spi_nor_wait_till_ready(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;
|