diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2019-05-31 17:15:37 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-06-03 10:55:38 +0200 |
commit | dad9bb017865ae794b6cdfac40d60b1466a09195 (patch) | |
tree | 0b3205e395a29ef6448f2084b25abfc31968734e /include/linux/device.h | |
parent | b06184acf751fa52a3763e4fadfd2807e9703acd (diff) |
driver core: Add helper device_find_child_by_name()
It looks like the child device is often matched with a name.
This introduces a helper that does it automatically.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 e85264fb6616..5489a759e1c5 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1250,6 +1250,8 @@ 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 struct device *device_find_child_by_name(struct device *parent, + const char *name); extern int device_rename(struct device *dev, const char *new_name); extern int device_move(struct device *dev, struct device *new_parent, enum dpm_order dpm_order); |