Patchwork pxa32xx_nand: add support for partition table parsing

login
register
mail settings
Submitter Marc Kleine-Budde
Date April 23, 2010, 9:25 p.m.
Message ID <1272057944-19380-1-git-send-email-mkl@pengutronix.de>
Download mbox | patch
Permalink /patch/50859/
State Accepted
Commit bff3c10d369440bc87ba612b45ba2777d2bf017f
Headers show

Comments

Marc Kleine-Budde - April 23, 2010, 9:25 p.m.
The pxa32xx_nand driver doesn't support partition tables from the
command line. This patch adds support for it.

Please review and consider to apply.

cheers, Marc


From a2caa92b08351511ee60bd94bf735be5f3a6fb65 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 23 Apr 2010 10:43:42 +0200
Subject: [PATCH] pxa32xx_nand: add support for partition table parsing

The pxa32xx_nand driver doesn't support partition tables from the
command line. This patch adds support for it.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/mtd/nand/pxa3xx_nand.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
Marc Kleine-Budde - April 28, 2010, 3:22 p.m.
Marc Kleine-Budde wrote:
> The pxa32xx_nand driver doesn't support partition tables from the
> command line. This patch adds support for it.
> 
> Please review and consider to apply.

Can someone please have a look at this patch.

Cheers, Marc

>>From a2caa92b08351511ee60bd94bf735be5f3a6fb65 Mon Sep 17 00:00:00 2001
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Fri, 23 Apr 2010 10:43:42 +0200
> Subject: [PATCH] pxa32xx_nand: add support for partition table parsing
> 
> The pxa32xx_nand driver doesn't support partition tables from the
> command line. This patch adds support for it.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  drivers/mtd/nand/pxa3xx_nand.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 5d55152..e02fa4f 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c
> @@ -1320,6 +1320,17 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
>  		goto fail_free_irq;
>  	}
>  
> +	if (mtd_has_cmdlinepart()) {
> +		static const char *probes[] = { "cmdlinepart", NULL };
> +		struct mtd_partition *parts;
> +		int nr_parts;
> +
> +		nr_parts = parse_mtd_partitions(mtd, probes, &parts, 0);
> +
> +		if (nr_parts)
> +			return add_mtd_partitions(mtd, parts, nr_parts);
> +	}
> +
>  	return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
>  
>  fail_free_irq:
Artem Bityutskiy - April 29, 2010, 5:47 a.m.
On Fri, 2010-04-23 at 23:25 +0200, Marc Kleine-Budde wrote:
> The pxa32xx_nand driver doesn't support partition tables from the
> command line. This patch adds support for it.
> 
> Please review and consider to apply.
> 
> cheers, Marc
> 
> 
> From a2caa92b08351511ee60bd94bf735be5f3a6fb65 Mon Sep 17 00:00:00 2001
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Fri, 23 Apr 2010 10:43:42 +0200
> Subject: [PATCH] pxa32xx_nand: add support for partition table parsing
> 
> The pxa32xx_nand driver doesn't support partition tables from the
> command line. This patch adds support for it.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Taken to l2-mtd-2.6.git / master.

Patch

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 5d55152..e02fa4f 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1320,6 +1320,17 @@  static int pxa3xx_nand_probe(struct platform_device *pdev)
 		goto fail_free_irq;
 	}
 
+	if (mtd_has_cmdlinepart()) {
+		static const char *probes[] = { "cmdlinepart", NULL };
+		struct mtd_partition *parts;
+		int nr_parts;
+
+		nr_parts = parse_mtd_partitions(mtd, probes, &parts, 0);
+
+		if (nr_parts)
+			return add_mtd_partitions(mtd, parts, nr_parts);
+	}
+
 	return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
 
 fail_free_irq: