diff options
| author | 2019-09-03 17:11:07 +0200 | |
|---|---|---|
| committer | 2019-09-03 17:11:07 +0200 | |
| commit | c5c0283a9db1c7ba5881f956a1faf2ebc3dfe70e (patch) | |
| tree | a4d44768f1591f40374c87eea9a28df8faccc103 /drivers/base/platform.c | |
| parent | usb: roles: Add fwnode_usb_role_switch_get() function (diff) | |
| parent | platform: Add platform_find_device_by_driver() helper (diff) | |
| download | wireguard-linux-c5c0283a9db1c7ba5881f956a1faf2ebc3dfe70e.tar.xz wireguard-linux-c5c0283a9db1c7ba5881f956a1faf2ebc3dfe70e.zip | |
Merge generic_lookup_helpers into usb-next
The lookup helpers are needed here.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
| -rw-r--r-- | drivers/base/platform.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 600913aea73b..ad78c810666a 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; |
