summaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-07-07 13:43:47 +0000
committerJohn Crispin <john@openwrt.org>2015-07-07 13:43:47 +0000
commitff08b0957026645e436c3388aa3f3f0032765106 (patch)
treebd023d085ea8774e977bc7200bf396eb7b1dca78 /target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
parent2658b33f68403dfc39b7cab6d27b9140284b6b92 (diff)
downloadmaster-31e0f0ae-ff08b0957026645e436c3388aa3f3f0032765106.tar.gz
master-31e0f0ae-ff08b0957026645e436c3388aa3f3f0032765106.tar.bz2
master-31e0f0ae-ff08b0957026645e436c3388aa3f3f0032765106.zip
lantiq: Add support for linux 4.1
All (still relevant) patches were refresh. The following patches were dropped because they are applied upstream: - 0003-MIPS-lantiq-handle-vmmc-memory-reservation.patch - 0005-MIPS-lantiq-add-reset-controller-api-support.patch - 0006-MIPS-lantiq-reboot-gphy-on-restart.patch - 0009-MIPS-lantiq-command-line-work-around.patch - 0010-MIPS-lantiq-export-soc-type.patch - 0011-lantiq-add-support-for-xrx200-firmware-depending-on-.patch - 0037-MIPS-lantiq-move-eiu-init-after-irq_domain-register.patch Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> SVN-Revision: 46216
Diffstat (limited to 'target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch')
-rw-r--r--target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch b/target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
new file mode 100644
index 0000000000..1f0ffe1bcf
--- /dev/null
+++ b/target/linux/lantiq/patches-4.1/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
@@ -0,0 +1,44 @@
+From 4400e1f593ea40a51912128adb4f53d59e62cad8 Mon Sep 17 00:00:00 2001
+From: John Crispin <blogic@openwrt.org>
+Date: Wed, 10 Sep 2014 22:40:18 +0200
+Subject: [PATCH 22/36] MTD: m25p80: allow loading mtd name from OF
+
+In accordance with the physmap flash we should honour the linux,mtd-name
+property when deciding what name the mtd device has.
+
+Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
+Signed-off-by: John Crispin <blogic@openwrt.org>
+---
+ drivers/mtd/devices/m25p80.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -19,6 +19,7 @@
+ #include <linux/errno.h>
+ #include <linux/module.h>
+ #include <linux/device.h>
++#include <linux/of.h>
+
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+@@ -184,6 +185,10 @@ static int m25p_probe(struct spi_device
+ enum read_mode mode = SPI_NOR_NORMAL;
+ char *flash_name = NULL;
+ int ret;
++ const char __maybe_unused *of_mtd_name = NULL;
++
++ of_property_read_string(spi->dev.of_node,
++ "linux,mtd-name", &of_mtd_name);
+
+ data = dev_get_platdata(&spi->dev);
+
+@@ -215,6 +220,8 @@ static int m25p_probe(struct spi_device
+
+ if (data && data->name)
+ flash->mtd.name = data->name;
++ else if (of_mtd_name)
++ flash->mtd.name = of_mtd_name;
+
+ /* For some (historical?) reason many platforms provide two different
+ * names in flash_platform_data: "name" and "type". Quite often name is