aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2018-09-20 14:23:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-20 13:37:28 +0200
commitcd7753d371388e712e3ee52b693459f9b71aaac2 (patch)
tree193f447b195cf0a658800449df6e9d5710f60051 /include/linux/device.h
parentplatform: x86: intel_cht_int33fe: Add dependency on muxes (diff)
downloadlinux-dev-cd7753d371388e712e3ee52b693459f9b71aaac2.tar.xz
linux-dev-cd7753d371388e712e3ee52b693459f9b71aaac2.zip
drivers: base: Helpers for adding device connection descriptions
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/device.h')
-rw-r--r--include/linux/device.h24
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.