diff options
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | drivers/of/platform.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index ba402c613ede..7dacc1ebe91e 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -21,13 +21,12 @@ extern struct device_attribute of_platform_device_attrs[]; | |||
21 | 21 | ||
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); | ||
25 | const struct of_device_id *matches = drv->of_match_table; | 24 | const struct of_device_id *matches = drv->of_match_table; |
26 | 25 | ||
27 | if (!matches) | 26 | if (!matches) |
28 | return 0; | 27 | return 0; |
29 | 28 | ||
30 | return of_match_device(matches, of_dev) != NULL; | 29 | return of_match_device(matches, dev) != NULL; |
31 | } | 30 | } |
32 | 31 | ||
33 | static int of_platform_device_probe(struct device *dev) | 32 | static int of_platform_device_probe(struct device *dev) |
@@ -45,7 +44,7 @@ static int of_platform_device_probe(struct device *dev) | |||
45 | 44 | ||
46 | of_dev_get(of_dev); | 45 | of_dev_get(of_dev); |
47 | 46 | ||
48 | match = of_match_device(drv->driver.of_match_table, of_dev); | 47 | match = of_match_device(drv->driver.of_match_table, dev); |
49 | if (match) | 48 | if (match) |
50 | error = drv->probe(of_dev, match); | 49 | error = drv->probe(of_dev, match); |
51 | if (error) | 50 | if (error) |