[RFC PATCH 56/57] drivers: Introduce driver_find_next_device() helper

Suzuki K Poulose
2019-06-03T15:52:35Z

Similar to bus_find_next_device(), add a helper to find
the next device for the given driver.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
include/linux/device.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 528efc0..39a7755 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -456,6 +456,12 @@ driver_find_device_by_fwnode(struct device_driver *drv,
return driver_find_device(drv, start, (void *)fwnode, device_match_fwnode);
}

+static inline struct device *driver_find_next_device(struct device_driver *drv,
+ struct device *start)
+{
+ return driver_find_device(drv, start, NULL, device_match_any);
+}
+
void driver_deferred_probe_add(struct device *dev);
int driver_deferred_probe_check_state(struct device *dev);

--
2.7.4