mtd: maps: physmap: allow partition parsers for physmap_flash_data
authorJonas Gorski <jonas.gorski@gmail.com>
Mon, 5 Dec 2011 15:08:09 +0000 (16:08 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:16:15 +0000 (18:16 +0000)
Arch setup code might want to use their own partition parsers, but still
use the generic physmap flash driver.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/physmap.c
include/linux/mtd/physmap.h

index 66e8200079c2c25633db8f662967825575b89915..1f749d58ae6f80f583fcba93d8c2c8e874124c07 100644 (file)
@@ -85,6 +85,7 @@ static int physmap_flash_probe(struct platform_device *dev)
        struct physmap_flash_data *physmap_data;
        struct physmap_flash_info *info;
        const char **probe_type;
+       const char **part_types;
        int err = 0;
        int i;
        int devices_found = 0;
@@ -171,7 +172,9 @@ static int physmap_flash_probe(struct platform_device *dev)
        if (err)
                goto err_out;
 
-       mtd_device_parse_register(info->cmtd, part_probe_types, 0,
+       part_types = physmap_data->part_probe_types ? : part_probe_types;
+
+       mtd_device_parse_register(info->cmtd, part_types, 0,
                                  physmap_data->parts, physmap_data->nr_parts);
        return 0;
 
index 04e018160e2b516be1e29c383e983036c31ffef6..d2887e76b7f66845b3662c9c52b80b211b78f38b 100644 (file)
@@ -30,6 +30,7 @@ struct physmap_flash_data {
        unsigned int            pfow_base;
        char                    *probe_type;
        struct mtd_partition    *parts;
+       const char              **part_probe_types;
 };
 
 #endif /* __LINUX_MTD_PHYSMAP__ */