From: Felix Fietkau Date: Fri, 31 Jul 2015 20:55:30 +0000 (+0000) Subject: bcm53xx: allow device tree to override SPI flash partition layout X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a5c34074742149eb3a416ed05b0838cbc7664526;p=librecmc%2Flibrecmc.git bcm53xx: allow device tree to override SPI flash partition layout Signed-off-by: Felix Fietkau SVN-Revision: 46538 --- 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 #include #include +#include -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;