Patchwork pxa2xx-flash.c

login
register
mail settings
Submitter =?ISO-8859-15?Q?Anders=20M=F8rk-Pedersen?=
Date Dec. 2, 2011, 2:40 p.m.
Message ID <4ED8F1600200008E00014323@mail.frogne.dk>
Download mbox | patch
Permalink /patch/128888/
State New
Headers show

Comments

Hi,

I've noticed a problem with a patch for the pxa2xx-flash.c map, which has been committed to the nextline kernel (currently 3.2-rc3)

The problem is that hardcoded mtd partitions are no longer probed - and that breaks a lot of board support modules.

The patch is described as 
"mtd: pxa2xx-flash.c: use mtd_device_parse_register"

and can be seen here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=6fcdc92fce81eadcee262a7a66bf3207314fab87

I have created a small patch to address this.

Best regards
Anders Mork-Pedersen <amp@frogne.dk>
Finn Frogne A/S
Artem Bityutskiy - Dec. 4, 2011, 2:29 p.m.
On Fri, 2011-12-02 at 15:40 +0100, Anders Mørk-Pedersen wrote:
> Hi,
> 
> I've noticed a problem with a patch for the pxa2xx-flash.c map, which has been committed to the nextline kernel (currently 3.2-rc3)
> 
> The problem is that hardcoded mtd partitions are no longer probed - and that breaks a lot of board support modules.
> 
> The patch is described as 
> "mtd: pxa2xx-flash.c: use mtd_device_parse_register"
> 
> and can be seen here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=6fcdc92fce81eadcee262a7a66bf3207314fab87
> 
> I have created a small patch to address this.

Looks OK, but could you please send a patch suitable for 'git am'? So
that I save your mail and give it to git-am and end up with a commit
which has you as the author, and a nice commit message. Also, please, CC
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com

Thanks!

Patch

diff -Nur linux-3.2-rc3/drivers/mtd/maps//pxa2xx-flash.c linux-3.2-rc3_patched/drivers/mtd/maps//pxa2xx-flash.c
--- linux-3.2-rc3/drivers/mtd/maps//pxa2xx-flash.c	2011-11-24 05:20:28.000000000 +0100
+++ linux-3.2-rc3_patched/drivers/mtd/maps//pxa2xx-flash.c	2011-12-02 12:50:38.000000000 +0100
@@ -54,6 +54,7 @@ 
 	struct flash_platform_data *flash = pdev->dev.platform_data;
 	struct pxa2xx_flash_info *info;
 	struct resource *res;
+	struct mtd_part_parser_data	ppdata;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -98,7 +99,10 @@ 
 	}
 	info->mtd->owner = THIS_MODULE;
 
-	mtd_device_parse_register(info->mtd, probes, 0, NULL, 0);
+	ppdata.of_node = pdev->dev.of_node;
+	mtd_device_parse_register(info->mtd, probes, &ppdata,
+			flash ? flash->parts : NULL,
+			flash ? flash->nr_parts : 0);
 
 	platform_set_drvdata(pdev, info);
 	return 0;