提交 67d02a1b 编写于 作者: U Uwe Kleine-König 提交者: Greg Kroah-Hartman

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: NThierry Reding <treding@nvidia.com>
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cf68d855
...@@ -949,8 +949,8 @@ static int platform_match(struct device *dev, struct device_driver *drv) ...@@ -949,8 +949,8 @@ static int platform_match(struct device *dev, struct device_driver *drv)
return !strcmp(pdev->driver_override, drv->name); return !strcmp(pdev->driver_override, drv->name);
/* Attempt an OF style match first */ /* Attempt an OF style match first */
if (of_driver_match_device(dev, drv)) if (pdev->dev.of_node)
return 1; return of_driver_match_device(dev, drv);
/* Then try ACPI style match */ /* Then try ACPI style match */
if (acpi_driver_match_device(dev, drv)) if (acpi_driver_match_device(dev, drv))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册