Author: nbd
Date: 2015-07-31 22:55:30 +0200 (Fri, 31 Jul 2015)
New Revision: 46538

Modified:
   trunk/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c
Log:
bcm53xx: allow device tree to override SPI flash partition layout

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c
===================================================================
--- trunk/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c      
2015-07-31 19:57:10 UTC (rev 46537)
+++ trunk/target/linux/bcm53xx/files/drivers/mtd/spi-nor/bcm53xxspiflash.c      
2015-07-31 20:55:30 UTC (rev 46538)
@@ -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 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 @@
        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;
 
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to