diff options
Diffstat (limited to 'drivers/mtd/maps/physmap_of.c')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 8506578e6a35..3db0cb083d31 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -216,8 +216,7 @@ static void __devinit of_free_probes(const char **probes) | |||
216 | } | 216 | } |
217 | #endif | 217 | #endif |
218 | 218 | ||
219 | static int __devinit of_flash_probe(struct platform_device *dev, | 219 | static int __devinit of_flash_probe(struct platform_device *dev) |
220 | const struct of_device_id *match) | ||
221 | { | 220 | { |
222 | #ifdef CONFIG_MTD_PARTITIONS | 221 | #ifdef CONFIG_MTD_PARTITIONS |
223 | const char **part_probe_types; | 222 | const char **part_probe_types; |
@@ -225,7 +224,7 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
225 | struct device_node *dp = dev->dev.of_node; | 224 | struct device_node *dp = dev->dev.of_node; |
226 | struct resource res; | 225 | struct resource res; |
227 | struct of_flash *info; | 226 | struct of_flash *info; |
228 | const char *probe_type = match->data; | 227 | const char *probe_type; |
229 | const __be32 *width; | 228 | const __be32 *width; |
230 | int err; | 229 | int err; |
231 | int i; | 230 | int i; |
@@ -235,6 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
235 | struct mtd_info **mtd_list = NULL; | 234 | struct mtd_info **mtd_list = NULL; |
236 | resource_size_t res_size; | 235 | resource_size_t res_size; |
237 | 236 | ||
237 | if (!dev->dev.of_match) | ||
238 | return -EINVAL; | ||
239 | probe_type = dev->dev.of_match->data; | ||
240 | |||
238 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); | 241 | reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32); |
239 | 242 | ||
240 | /* | 243 | /* |
@@ -418,7 +421,7 @@ static struct of_device_id of_flash_match[] = { | |||
418 | }; | 421 | }; |
419 | MODULE_DEVICE_TABLE(of, of_flash_match); | 422 | MODULE_DEVICE_TABLE(of, of_flash_match); |
420 | 423 | ||
421 | static struct of_platform_driver of_flash_driver = { | 424 | static struct platform_driver of_flash_driver = { |
422 | .driver = { | 425 | .driver = { |
423 | .name = "of-flash", | 426 | .name = "of-flash", |
424 | .owner = THIS_MODULE, | 427 | .owner = THIS_MODULE, |
@@ -430,12 +433,12 @@ static struct of_platform_driver of_flash_driver = { | |||
430 | 433 | ||
431 | static int __init of_flash_init(void) | 434 | static int __init of_flash_init(void) |
432 | { | 435 | { |
433 | return of_register_platform_driver(&of_flash_driver); | 436 | return platform_driver_register(&of_flash_driver); |
434 | } | 437 | } |
435 | 438 | ||
436 | static void __exit of_flash_exit(void) | 439 | static void __exit of_flash_exit(void) |
437 | { | 440 | { |
438 | of_unregister_platform_driver(&of_flash_driver); | 441 | platform_driver_unregister(&of_flash_driver); |
439 | } | 442 | } |
440 | 443 | ||
441 | module_init(of_flash_init); | 444 | module_init(of_flash_init); |