diff options
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/platform.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index d58ade170c4b..9fd7f7d0a0d1 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -22,8 +22,7 @@ extern struct device_attribute of_platform_device_attrs[]; | |||
22 | static int of_platform_bus_match(struct device *dev, struct device_driver *drv) | 22 | static 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 | struct of_device *of_dev = to_of_device(dev); |
25 | struct of_platform_driver *of_drv = to_of_platform_driver(drv); | 25 | const struct of_device_id *matches = drv->of_match_table; |
26 | const struct of_device_id *matches = of_drv->match_table; | ||
27 | 26 | ||
28 | if (!matches) | 27 | if (!matches) |
29 | return 0; | 28 | return 0; |
@@ -46,7 +45,7 @@ static int of_platform_device_probe(struct device *dev) | |||
46 | 45 | ||
47 | of_dev_get(of_dev); | 46 | of_dev_get(of_dev); |
48 | 47 | ||
49 | match = of_match_device(drv->match_table, of_dev); | 48 | match = of_match_device(drv->driver.of_match_table, of_dev); |
50 | if (match) | 49 | if (match) |
51 | error = drv->probe(of_dev, match); | 50 | error = drv->probe(of_dev, match); |
52 | if (error) | 51 | if (error) |
@@ -391,6 +390,8 @@ int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus) | |||
391 | drv->driver.name = drv->name; | 390 | drv->driver.name = drv->name; |
392 | if (!drv->driver.owner) | 391 | if (!drv->driver.owner) |
393 | drv->driver.owner = drv->owner; | 392 | drv->driver.owner = drv->owner; |
393 | if (!drv->driver.of_match_table) | ||
394 | drv->driver.of_match_table = drv->match_table; | ||
394 | drv->driver.bus = bus; | 395 | drv->driver.bus = bus; |
395 | 396 | ||
396 | /* register with core */ | 397 | /* register with core */ |