diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-06-08 09:48:20 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-07-24 11:57:51 -0400 |
commit | 05212157e94ccf4cf458413bbba509cfa95ff92b (patch) | |
tree | 16c18d97305ea5c16dc8e5d1626c147301a5dce1 /drivers/base | |
parent | 4e4f62bf7396fca48efe61513640ee399a6046e3 (diff) |
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 <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
CC: Michal Simek <monstr@monstr.eu>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: linux-kernel@vger.kernel.org
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org
Diffstat (limited to 'drivers/base')
-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 4d99c8bdfed..fac3633c722 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 | ||