summaryrefslogtreecommitdiff
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-30 13:26:39 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-30 13:26:39 +0200
commitf87da58b797aa591f2e288c7012faf3ab1e54c55 (patch)
treec1c991fe1350515a7b5ca01818f66f677cc0e14e /drivers/base/platform.c
parentfb583c8eeeb1fd57e24ef41ed94c9112067aeac9 (diff)
parent36f3313d6bff91ab2a9e47698c27d15363640a4e (diff)
downloadlwn-f87da58b797aa591f2e288c7012faf3ab1e54c55.tar.gz
lwn-f87da58b797aa591f2e288c7012faf3ab1e54c55.zip
Merge branch 'generic_lookup_helpers' into driver-core-next
This was on a separate branch so that others can pull it in. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 506a0175a5a7..a174ce5ea17c 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -1197,6 +1197,20 @@ struct bus_type platform_bus_type = {
};
EXPORT_SYMBOL_GPL(platform_bus_type);
+/**
+ * platform_find_device_by_driver - Find a platform device with a given
+ * driver.
+ * @start: The device to start the search from.
+ * @drv: The device driver to look for.
+ */
+struct device *platform_find_device_by_driver(struct device *start,
+ const struct device_driver *drv)
+{
+ return bus_find_device(&platform_bus_type, start, drv,
+ (void *)platform_match);
+}
+EXPORT_SYMBOL_GPL(platform_find_device_by_driver);
+
int __init platform_bus_init(void)
{
int error;