diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2014-10-27 23:02:08 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2014-10-27 23:02:08 +0000 |
commit | c45a73ac33a699b8bd851b52f681b1ceddf6d3c0 (patch) | |
tree | 8b2c252e425f24f3a0b9d04ae7be4cf314cd7a24 /target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch | |
parent | 9a6776f829619ffda5511ed8772cdddbfde4d295 (diff) | |
download | upstream-c45a73ac33a699b8bd851b52f681b1ceddf6d3c0.tar.gz upstream-c45a73ac33a699b8bd851b52f681b1ceddf6d3c0.tar.bz2 upstream-c45a73ac33a699b8bd851b52f681b1ceddf6d3c0.zip |
bcm53xx: initial support for kernel 3.18
This adds initial support for kernel 3.18.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43097 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch')
-rw-r--r-- | target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch b/target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch new file mode 100644 index 0000000000..de1e506255 --- /dev/null +++ b/target/linux/bcm53xx/patches-3.18/402-mtd-spi-nor-allow-NULL-as-spi_device_id-in-spi_nor_s.patch @@ -0,0 +1,46 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -926,29 +926,23 @@ int spi_nor_scan(struct spi_nor *nor, co + if (ret) + return ret; + +- info = (void *)id->driver_data; +- +- if (info->jedec_id) { +- const struct spi_device_id *jid; +- +- jid = nor->read_id(nor); +- if (IS_ERR(jid)) { +- return PTR_ERR(jid); +- } else if (jid != id) { +- /* +- * JEDEC knows better, so overwrite platform ID. We +- * can't trust partitions any longer, but we'll let +- * mtd apply them anyway, since some partitions may be +- * marked read-only, and we don't want to lose that +- * information, even if it's not 100% accurate. +- */ +- dev_warn(dev, "found %s, expected %s\n", +- jid->name, id->name); +- id = jid; +- info = (void *)jid->driver_data; ++ if (id) { ++ info = (void *)id->driver_data; ++ if (info->jedec_id) { ++ dev_warn(dev, ++ "passed SPI device ID (%s) contains JEDEC, ignoring it, driver should be fixed!\n", ++ id->name); ++ id = NULL; + } + } + ++ if (!id) { ++ id = nor->read_id(nor); ++ if (IS_ERR(id)) ++ return PTR_ERR(id); ++ } ++ info = (void *)id->driver_data; ++ + mutex_init(&nor->lock); + + /* |