diff options
author | Andy Shevchenko | 2015-07-27 17:04:00 +0200 |
---|---|---|
committer | Lee Jones | 2015-07-28 09:50:42 +0200 |
commit | 3d060aeb72113cda0acf906bfe26914fc689506a (patch) | |
tree | 683028071415f9724d618e8a4f84124a10111a6d /include/linux/device.h | |
parent | klist: implement klist_prev() (diff) | |
download | kernel-qcow2-linux-3d060aeb72113cda0acf906bfe26914fc689506a.tar.gz kernel-qcow2-linux-3d060aeb72113cda0acf906bfe26914fc689506a.tar.xz kernel-qcow2-linux-3d060aeb72113cda0acf906bfe26914fc689506a.zip |
driver core: implement device_for_each_child_reverse()
The new function device_for_each_child_reverse() is helpful to traverse the
registered devices in a reversed order, e.g. in the case when an operation on
each device should be done first on the last added device, then on one before
last and so on.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 5a31bf3a4024..af6fbc35d8a6 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -958,6 +958,8 @@ extern int __must_check device_add(struct device *dev); extern void device_del(struct device *dev); extern int device_for_each_child(struct device *dev, void *data, int (*fn)(struct device *dev, void *data)); +extern int device_for_each_child_reverse(struct device *dev, void *data, + int (*fn)(struct device *dev, void *data)); extern struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *dev, void *data)); extern int device_rename(struct device *dev, const char *new_name); |