[PATCH 6/6] mtd/denali: support for cmdline partitioning
Jamie Iles
jamie at jamieiles.com
Fri Jun 3 06:17:18 EDT 2011
Add support for command line partitioning. This is favoured over
platform data based partitions.
Cc: David Woodhouse <dwmw2 at infradead.org>
Cc: Chuanxiao Dong <chuanxiao.dong at intel.com>
Cc: Artem Bityutskiy <dedekind1 at gmail.com>
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
drivers/mtd/nand/denali.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 19998ed..4e440d6 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1420,6 +1420,9 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
struct denali_nand_info *denali;
int ret;
struct denali_nand_pdata *pdata;
+ struct mtd_partition *partitions = NULL;
+ int nr_parts = 0;
+ const char *part_probes[] = { "cmdlinepart", NULL };
denali = kzalloc(sizeof(*denali), GFP_KERNEL);
if (!denali)
@@ -1645,7 +1648,11 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
goto failed_req_irq;
}
- if (pdata && pdata->parts)
+ nr_parts = parse_mtd_partitions(&denali->mtd, part_probes,
+ &partitions, 0);
+ if (partitions && nr_parts > 0)
+ ret = mtd_device_register(&denali->mtd, partitions, nr_parts);
+ else if (pdata && pdata->parts)
ret = mtd_device_register(&denali->mtd, pdata->parts,
pdata->nr_parts);
else
--
1.7.4.1
More information about the linux-mtd
mailing list