Commit 529688fed64a7759323cbd170754c61aad0dd48b

Authored by Jonas Gorski
Committed by David Woodhouse
1 parent 70a3c167c4

mtd: maps: physmap: allow partition parsers for physmap_flash_data

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>

Showing 2 changed files with 5 additions and 1 deletions Side-by-side Diff

drivers/mtd/maps/physmap.c
... ... @@ -85,6 +85,7 @@
85 85 struct physmap_flash_data *physmap_data;
86 86 struct physmap_flash_info *info;
87 87 const char **probe_type;
  88 + const char **part_types;
88 89 int err = 0;
89 90 int i;
90 91 int devices_found = 0;
... ... @@ -171,7 +172,9 @@
171 172 if (err)
172 173 goto err_out;
173 174  
174   - mtd_device_parse_register(info->cmtd, part_probe_types, 0,
  175 + part_types = physmap_data->part_probe_types ? : part_probe_types;
  176 +
  177 + mtd_device_parse_register(info->cmtd, part_types, 0,
175 178 physmap_data->parts, physmap_data->nr_parts);
176 179 return 0;
177 180  
include/linux/mtd/physmap.h
... ... @@ -30,6 +30,7 @@
30 30 unsigned int pfow_base;
31 31 char *probe_type;
32 32 struct mtd_partition *parts;
  33 + const char **part_probe_types;
33 34 };
34 35  
35 36 #endif /* __LINUX_MTD_PHYSMAP__ */