X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Flantiq%2Fpatches-4.19%2F0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch;h=90dc20b901be433bb235eda74993861972a7d0a4;hb=f0c740650b466ffacae64a6f7b67ffacdaf28efd;hp=415c8579bdf7ee5483381d58a8e9bdfba81bc13d;hpb=eee1b34ce688efcb824ea9ce08edfce7ec507599;p=openwrt%2Fstaging%2Fblogic.git diff --git a/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch b/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch index 415c8579bdf7..90dc20b901be 100644 --- a/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch +++ b/target/linux/lantiq/patches-4.19/0022-MTD-m25p80-allow-loading-mtd-name-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include #include -@@ -245,6 +246,10 @@ static int m25p_probe(struct spi_device +@@ -180,6 +181,10 @@ static int m25p_probe(struct spi_mem *sp }; char *flash_name; int ret; @@ -31,14 +31,14 @@ Signed-off-by: John Crispin + of_property_read_string(spi->dev.of_node, + "linux,mtd-name", &of_mtd_name); - data = dev_get_platdata(&spi->dev); + data = dev_get_platdata(&spimem->spi->dev); -@@ -283,6 +288,8 @@ static int m25p_probe(struct spi_device +@@ -218,6 +223,8 @@ static int m25p_probe(struct spi_mem *sp if (data && data->name) nor->mtd.name = data->name; + else if (of_mtd_name) + nor->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 + if (!nor->mtd.name) + nor->mtd.name = spi_mem_get_name(spimem);