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

Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
---
 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

Reply via email to