diff options
-rw-r--r-- | drivers/base/platform.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4d99c8bdfedc..fac3633c7223 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/of_device.h> | ||
15 | #include <linux/module.h> | 16 | #include <linux/module.h> |
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
@@ -673,7 +674,11 @@ static int platform_match(struct device *dev, struct device_driver *drv) | |||
673 | struct platform_device *pdev = to_platform_device(dev); | 674 | struct platform_device *pdev = to_platform_device(dev); |
674 | struct platform_driver *pdrv = to_platform_driver(drv); | 675 | struct platform_driver *pdrv = to_platform_driver(drv); |
675 | 676 | ||
676 | /* match against the id table first */ | 677 | /* Attempt an OF style match first */ |
678 | if (of_driver_match_device(dev, drv)) | ||
679 | return 1; | ||
680 | |||
681 | /* Then try to match against the id table */ | ||
677 | if (pdrv->id_table) | 682 | if (pdrv->id_table) |
678 | return platform_match_id(pdrv->id_table, pdev) != NULL; | 683 | return platform_match_id(pdrv->id_table, pdev) != NULL; |
679 | 684 | ||