diff options
Diffstat (limited to 'drivers/mtd/maps/physmap_of.c')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index bd483f0c57e1..c1d33464aee8 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -214,11 +214,13 @@ static void __devinit of_free_probes(const char **probes) | |||
214 | } | 214 | } |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | static struct of_device_id of_flash_match[]; | ||
217 | static int __devinit of_flash_probe(struct platform_device *dev) | 218 | static int __devinit of_flash_probe(struct platform_device *dev) |
218 | { | 219 | { |
219 | #ifdef CONFIG_MTD_PARTITIONS | 220 | #ifdef CONFIG_MTD_PARTITIONS |
220 | const char **part_probe_types; | 221 | const char **part_probe_types; |
221 | #endif | 222 | #endif |
223 | const struct of_device_id *match; | ||
222 | struct device_node *dp = dev->dev.of_node; | 224 | struct device_node *dp = dev->dev.of_node; |
223 | struct resource res; | 225 | struct resource res; |
224 | struct of_flash *info; | 226 | struct of_flash *info; |
@@ -232,9 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev) | |||
232 | struct mtd_info **mtd_list = NULL; | 234 | struct mtd_info **mtd_list = NULL; |
233 | resource_size_t res_size; | 235 | resource_size_t res_size; |
234 | 236 | ||
235 | if (!dev->dev.of_match) | 237 | match = of_match_device(of_flash_match, &dev->dev); |
238 | if (!match) | ||
236 | return -EINVAL; | 239 | return -EINVAL; |
237 | probe_type = dev->dev.of_match->data; | 240 | probe_type = match->data; |
238 | 241 | ||
239 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); | 242 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); |
240 | 243 | ||