>From 4e2507e892c8ccb3726a549e52ffcafe7c477fae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anders=20M=C3=B8rk-Pedersen?= <amp@frogne.dk>
Date: Mon, 5 Dec 2011 07:42:07 +0100
Subject: [PATCH] Enables the mtd-driver to use hardcoded partitions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

After the pxa2xx-flash driver was updated to use the mtd_device_parse_register interface (6fcdc92fce81eadce...), it has not been possible to define the partition layout in the board support package - as is often seen done. This breaks support for many pxa2xx-boards.

Signed-off-by: Anders Mørk-Pedersen <amp@frogne.dk>
---
 drivers/mtd/maps/pxa2xx-flash.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 411a17d..37709a6 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -54,6 +54,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 	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 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 	}
 	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;
-- 
1.7.1

