aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-11-13 03:14:20 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-09 20:39:33 -0500
commit67d02a1bbb334558e9380409a3cd426b36d4578b (patch)
tree62755f35efb5515d532ed25dbdce830c7f46a602
parentcf68d85529f7dccc24412887d46e364f4b422a5d (diff)
driver-core: platform: probe of-devices only using list of compatibles
There are several indications that make a platform device match a platform driver. For devices that are instantiated by a device tree matching by name, id table or acpi mechanisms doesn't make sense and might result in surprising effects. So limit matching to use the driver's of_match_table for these. Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index f437afa17f2b..1b5b7b5b50c0 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -949,8 +949,8 @@ static int platform_match(struct device *dev, struct device_driver *drv)
949 return !strcmp(pdev->driver_override, drv->name); 949 return !strcmp(pdev->driver_override, drv->name);
950 950
951 /* Attempt an OF style match first */ 951 /* Attempt an OF style match first */
952 if (of_driver_match_device(dev, drv)) 952 if (pdev->dev.of_node)
953 return 1; 953 return of_driver_match_device(dev, drv);
954 954
955 /* Then try ACPI style match */ 955 /* Then try ACPI style match */
956 if (acpi_driver_match_device(dev, drv)) 956 if (acpi_driver_match_device(dev, drv))