diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2018-09-20 14:23:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-03 06:26:30 +0200 |
commit | e99d90ce77500f7b9b706bf2b632cc631ca2e307 (patch) | |
tree | 2e012515016982eb5dc4517a98e7b6322704b82d /include/linux | |
parent | f5959dec081a59d1019509fa21320def183f78c8 (diff) | |
download | linux-stable-e99d90ce77500f7b9b706bf2b632cc631ca2e307.tar.gz linux-stable-e99d90ce77500f7b9b706bf2b632cc631ca2e307.tar.bz2 linux-stable-e99d90ce77500f7b9b706bf2b632cc631ca2e307.zip |
drivers: base: Helpers for adding device connection descriptions
commit cd7753d371388e712e3ee52b693459f9b71aaac2 upstream.
Introducing helpers for adding and removing multiple device
connection descriptions at once.
Acked-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/device.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 8f882549edee..3f1066a9e1c3 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -774,6 +774,30 @@ void device_connection_add(struct device_connection *con); void device_connection_remove(struct device_connection *con); /** + * device_connections_add - Add multiple device connections at once + * @cons: Zero terminated array of device connection descriptors + */ +static inline void device_connections_add(struct device_connection *cons) +{ + struct device_connection *c; + + for (c = cons; c->endpoint[0]; c++) + device_connection_add(c); +} + +/** + * device_connections_remove - Remove multiple device connections at once + * @cons: Zero terminated array of device connection descriptors + */ +static inline void device_connections_remove(struct device_connection *cons) +{ + struct device_connection *c; + + for (c = cons; c->endpoint[0]; c++) + device_connection_remove(c); +} + +/** * enum device_link_state - Device link states. * @DL_STATE_NONE: The presence of the drivers is not being tracked. * @DL_STATE_DORMANT: None of the supplier/consumer drivers is present. |