kernel: update linux 3.2 to 3.2.15
[openwrt.git] / target / linux / ixp4xx / patches-3.3 / 010-backport_ixp4xx_mtd_fix.patch
1 commit a3c1e3b732b3708a80e4035b9d845f3f7c7dd0c9
2 Author: Marc Kleine-Budde <mkl@blackshift.org>
3 Date:   Wed Feb 8 20:24:29 2012 +0100
4
5     mtd: ixp4xx: oops in ixp4xx_flash_probe
6     
7     In commit "c797533 mtd: abstract last MTD partition parser argument" the
8     third argument of "mtd_device_parse_register()" changed from start address
9     of the MTD device to a pointer to a struct.
10     
11     The "ixp4xx_flash_probe()" function was not converted properly, causing
12     an oops during boot.
13     
14     This patch fixes the problem by filling the needed information into a
15     "struct mtd_part_parser_data" and passing it to
16     "mtd_device_parse_register()".
17     
18     Signed-off-by: Marc Kleine-Budde <mkl@blackshift.org>
19     Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
20     Cc: stable@kernel.org [3.2+]
21     Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
22
23 --- a/drivers/mtd/maps/ixp4xx.c
24 +++ b/drivers/mtd/maps/ixp4xx.c
25 @@ -182,6 +182,9 @@ static int ixp4xx_flash_probe(struct pla
26  {
27         struct flash_platform_data *plat = dev->dev.platform_data;
28         struct ixp4xx_flash_info *info;
29 +       struct mtd_part_parser_data ppdata = {
30 +               .origin = dev->resource->start,
31 +       };
32         int err = -1;
33  
34         if (!plat)
35 @@ -247,7 +250,7 @@ static int ixp4xx_flash_probe(struct pla
36         /* Use the fast version */
37         info->map.write = ixp4xx_write16;
38  
39 -       err = mtd_device_parse_register(info->mtd, probes, dev->resource->start,
40 +       err = mtd_device_parse_register(info->mtd, probes, &ppdata,
41                         plat->parts, plat->nr_parts);
42         if (err) {
43                 printk(KERN_ERR "Could not parse partitions\n");