mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
2e0fed7f7c
commit
3d060aeb72
2 changed files with 45 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue