diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2009-05-12 13:46:59 -0700 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-05 18:11:55 +0100 |
commit | f36e20c01ad0104688f2eaebdf2213e749929c97 (patch) | |
tree | 40e82b3977e792464e7ab9b1f0cf402feec309e9 /drivers/mtd | |
parent | bf95efd41b1a760128eb25402791b0a4941eb655 (diff) |
mtd: plat_nand: allow platform to set partitions
Add optional callback to allow platform to initialize partitions.
Static partitions on a nand device could vary depending on the size of the
device. This patch allows an optional platform callback to be used to
setup this partition information at runtime.
Scan order is:
1) chip.part_probe_types
2) chip.set_parts
3) chip.partitions
4) full mtd device (fallback for no partitions)
Some of the existing nand drivers could possibly be replaced by the
plat_nand driver by using this patch. These include autcpu12.c and
ts7250.c drivers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/plat_nand.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 22e0ce788419..4e16c6f5bdd5 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -95,6 +95,8 @@ static int __devinit plat_nand_probe(struct platform_device *pdev) return 0; } } + if (pdata->chip.set_parts) + pdata->chip.set_parts(data->mtd.size, &pdata->chip); if (pdata->chip.partitions) { data->parts = pdata->chip.partitions; res = add_mtd_partitions(&data->mtd, data->parts, |