From: Grant Likely Date: Tue, 8 Jun 2010 13:48:20 +0000 (-0600) Subject: drivercore/of: Add OF style matching to platform bus X-Git-Tag: firefly_0821_release~9833^2~1278^2~19 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=05212157e94ccf4cf458413bbba509cfa95ff92b;p=firefly-linux-kernel-4.4.55.git drivercore/of: Add OF style matching to platform bus As part of the merge between platform bus and of_platform bus, add the ability to do of-style matching to the platform bus. Signed-off-by: Grant Likely Acked-by: Greg Kroah-Hartman CC: Michal Simek CC: Grant Likely CC: Benjamin Herrenschmidt CC: Stephen Rothwell CC: linux-kernel@vger.kernel.org CC: microblaze-uclinux@itee.uq.edu.au CC: linuxppc-dev@ozlabs.org CC: devicetree-discuss@lists.ozlabs.org --- 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 @@ #include #include +#include #include #include #include @@ -673,7 +674,11 @@ static int platform_match(struct device *dev, struct device_driver *drv) struct platform_device *pdev = to_platform_device(dev); struct platform_driver *pdrv = to_platform_driver(drv); - /* match against the id table first */ + /* Attempt an OF style match first */ + if (of_driver_match_device(dev, drv)) + return 1; + + /* Then try to match against the id table */ if (pdrv->id_table) return platform_match_id(pdrv->id_table, pdev) != NULL;