aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r--drivers/of/platform.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index d58ade170c4b..7dacc1ebe91e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -21,14 +21,12 @@ extern struct device_attribute of_platform_device_attrs[];
21 21
22static int of_platform_bus_match(struct device *dev, struct device_driver *drv) 22static int of_platform_bus_match(struct device *dev, struct device_driver *drv)
23{ 23{
24 struct of_device *of_dev = to_of_device(dev); 24 const struct of_device_id *matches = drv->of_match_table;
25 struct of_platform_driver *of_drv = to_of_platform_driver(drv);
26 const struct of_device_id *matches = of_drv->match_table;
27 25
28 if (!matches) 26 if (!matches)
29 return 0; 27 return 0;
30 28
31 return of_match_device(matches, of_dev) != NULL; 29 return of_match_device(matches, dev) != NULL;
32} 30}
33 31
34static int of_platform_device_probe(struct device *dev) 32static int of_platform_device_probe(struct device *dev)
@@ -46,7 +44,7 @@ static int of_platform_device_probe(struct device *dev)
46 44
47 of_dev_get(of_dev); 45 of_dev_get(of_dev);
48 46
49 match = of_match_device(drv->match_table, of_dev); 47 match = of_match_device(drv->driver.of_match_table, dev);
50 if (match) 48 if (match)
51 error = drv->probe(of_dev, match); 49 error = drv->probe(of_dev, match);
52 if (error) 50 if (error)
@@ -386,11 +384,6 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
386 384
387int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) 385int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
388{ 386{
389 /* initialize common driver fields */
390 if (!drv->driver.name)
391 drv->driver.name = drv->name;
392 if (!drv->driver.owner)
393 drv->driver.owner = drv->owner;
394 drv->driver.bus = bus; 387 drv->driver.bus = bus;
395 388
396 /* register with core */ 389 /* register with core */