mtd: mchp23k256: add partitioning support
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Fri, 2 Jun 2017 03:21:18 +0000 (15:21 +1200)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 8 Jun 2017 23:28:03 +0000 (16:28 -0700)
Setting the of_node for the mtd device allows the generic mtd code to
setup the partitions.

[Editorial note (Brian): patch still pending on fixing up the "aligned
to eraseblock" partition sanity check, given that this SRAM has no
eraseblocks.]

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/devices/mchp23k256.c

index 2542f5b8b63fc4d8157d66692e8e4c1a66747f2e..3e5feb4546440a9d4429da68476ab65d0b1daa48 100644 (file)
@@ -143,6 +143,7 @@ static int mchp23k256_probe(struct spi_device *spi)
 
        data = dev_get_platdata(&spi->dev);
 
+       mtd_set_of_node(&flash->mtd, spi->dev.of_node);
        flash->mtd.dev.parent   = &spi->dev;
        flash->mtd.type         = MTD_RAM;
        flash->mtd.flags        = MTD_CAP_RAM;