diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-07-31 20:55:30 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-07-31 20:55:30 +0000 |
commit | 23a8fd0e6b2a894407651f57029bc191978d6efd (patch) | |
tree | ef0b34133a79cc883a4ec6163a2c713cee719e11 /target/linux/bcm53xx/files | |
parent | 0245ba2de3fa457485bf13c4ab827705b2f60847 (diff) | |
download | master-187ad058-23a8fd0e6b2a894407651f57029bc191978d6efd.tar.gz master-187ad058-23a8fd0e6b2a894407651f57029bc191978d6efd.tar.bz2 master-187ad058-23a8fd0e6b2a894407651f57029bc191978d6efd.zip |
bcm53xx: allow device tree to override SPI flash partition layout
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46538 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/bcm53xx/files')
-rw-r--r-- | target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c b/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c index f192f4e59b..954b9c5527 100644 --- a/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c +++ b/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c @@ -4,8 +4,9 @@ #include <linux/mtd/spi-nor.h> #include <linux/mtd/mtd.h> #include <linux/mtd/cfi.h> +#include <linux/mtd/partitions.h> -static const char * const probes[] = { "bcm47xxpart", NULL }; +static const char * const probes[] = { "ofpart", "bcm47xxpart", NULL }; struct bcm53xxsf { struct spi_device *spi; @@ -176,6 +177,7 @@ static const char *bcm53xxspiflash_chip_name(struct spi_nor *nor) static int bcm53xxspiflash_probe(struct spi_device *spi) { + struct mtd_part_parser_data parser_data = {}; struct bcm53xxsf *b53sf; struct spi_nor *nor; int err; @@ -203,7 +205,9 @@ static int bcm53xxspiflash_probe(struct spi_device *spi) if (err) return err; - err = mtd_device_parse_register(&b53sf->mtd, probes, NULL, NULL, 0); + parser_data.of_node = spi->master->dev.parent->of_node; + err = mtd_device_parse_register(&b53sf->mtd, probes, &parser_data, + NULL, 0); if (err) return err; |