From b118879cc39270c623239a9775ad3acdfdbbcc35 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 21 Aug 2014 21:10:29 +0000 Subject: bcm53xx: backport more spi-nor patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki SVN-Revision: 42259 --- ...pport-for-struct-flash_platform_data-into.patch | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 target/linux/bcm53xx/patches-3.14/400-mtd-move-support-for-struct-flash_platform_data-into.patch (limited to 'target/linux/bcm53xx/patches-3.14/400-mtd-move-support-for-struct-flash_platform_data-into.patch') diff --git a/target/linux/bcm53xx/patches-3.14/400-mtd-move-support-for-struct-flash_platform_data-into.patch b/target/linux/bcm53xx/patches-3.14/400-mtd-move-support-for-struct-flash_platform_data-into.patch new file mode 100644 index 0000000000..8076f550ba --- /dev/null +++ b/target/linux/bcm53xx/patches-3.14/400-mtd-move-support-for-struct-flash_platform_data-into.patch @@ -0,0 +1,52 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -915,7 +915,6 @@ int spi_nor_scan(struct spi_nor *nor, co + enum read_mode mode) + { + struct flash_info *info; +- struct flash_platform_data *data; + struct device *dev = nor->dev; + struct mtd_info *mtd = nor->mtd; + struct device_node *np = dev->of_node; +@@ -926,28 +925,6 @@ int spi_nor_scan(struct spi_nor *nor, co + if (ret) + return ret; + +- /* Platform data helps sort out which chip type we have, as +- * well as how this board partitions it. If we don't have +- * a chip ID, try the JEDEC id commands; they'll work for most +- * newer chips, even if we don't recognize the particular chip. +- */ +- data = dev_get_platdata(dev); +- if (data && data->type) { +- const struct spi_device_id *plat_id; +- +- for (i = 0; i < ARRAY_SIZE(spi_nor_ids) - 1; i++) { +- plat_id = &spi_nor_ids[i]; +- if (strcmp(data->type, plat_id->name)) +- continue; +- break; +- } +- +- if (i < ARRAY_SIZE(spi_nor_ids) - 1) +- id = plat_id; +- else +- dev_warn(dev, "unrecognized id %s\n", data->type); +- } +- + info = (void *)id->driver_data; + + if (info->jedec_id) { +@@ -985,11 +962,8 @@ int spi_nor_scan(struct spi_nor *nor, co + write_sr(nor, 0); + } + +- if (data && data->name) +- mtd->name = data->name; +- else ++ if (!mtd->name) + mtd->name = dev_name(dev); +- + mtd->type = MTD_NORFLASH; + mtd->writesize = 1; + mtd->flags = MTD_CAP_NORFLASH; -- cgit v1.2.3