diff mbox series

[v2,8/8] iio: Rename iio_trigger_alloc dev argument to parent

Message ID 20201216042545.88176-1-gwendal@chromium.org (mailing list archive)
State New, archived
Headers show
Series iio: Set default trigger device parent | expand

Commit Message

Gwendal Grignou Dec. 16, 2020, 4:25 a.m. UTC
To be consistent with iio_device_alloc, name the parameter
device the trigger connected to as parent explicitely.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
 drivers/iio/industrialio-trigger.c | 16 ++++++++--------
 include/linux/iio/iio.h            |  2 +-
 include/linux/iio/trigger.h        |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 83006d1f7eea..0ce57dba464c 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -517,7 +517,7 @@  static void iio_trig_subirqunmask(struct irq_data *d)
 }
 
 static __printf(2, 0)
-struct iio_trigger *viio_trigger_alloc(struct device *dev,
+struct iio_trigger *viio_trigger_alloc(struct device *parent,
 				       const char *fmt,
 				       va_list vargs)
 {
@@ -528,7 +528,7 @@  struct iio_trigger *viio_trigger_alloc(struct device *dev,
 	if (!trig)
 		return NULL;
 
-	trig->dev.parent = dev;
+	trig->dev.parent = parent;
 	trig->dev.type = &iio_trig_type;
 	trig->dev.bus = &iio_bus_type;
 	device_initialize(&trig->dev);
@@ -566,7 +566,7 @@  struct iio_trigger *viio_trigger_alloc(struct device *dev,
 
 /**
  * iio_trigger_alloc - Allocate a trigger
- * @dev:		Device to allocate iio_trigger for
+ * @parent:		Device to allocate iio_trigger for
  * @fmt:		trigger name format. If it includes format
  *			specifiers, the additional arguments following
  *			format are formatted and inserted in the resulting
@@ -574,13 +574,13 @@  struct iio_trigger *viio_trigger_alloc(struct device *dev,
  * RETURNS:
  * Pointer to allocated iio_trigger on success, NULL on failure.
  */
-struct iio_trigger *iio_trigger_alloc(struct device *dev, const char *fmt, ...)
+struct iio_trigger *iio_trigger_alloc(struct device *parent, const char *fmt, ...)
 {
 	struct iio_trigger *trig;
 	va_list vargs;
 
 	va_start(vargs, fmt);
-	trig = viio_trigger_alloc(dev, fmt, vargs);
+	trig = viio_trigger_alloc(parent, fmt, vargs);
 	va_end(vargs);
 
 	return trig;
@@ -607,7 +607,7 @@  static void devm_iio_trigger_release(struct device *dev, void *res)
  * RETURNS:
  * Pointer to allocated iio_trigger on success, NULL on failure.
  */
-struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
+struct iio_trigger *devm_iio_trigger_alloc(struct device *parent,
 					   const char *fmt, ...)
 {
 	struct iio_trigger **ptr, *trig;
@@ -620,11 +620,11 @@  struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
 
 	/* use raw alloc_dr for kmalloc caller tracing */
 	va_start(vargs, fmt);
-	trig = viio_trigger_alloc(dev, fmt, vargs);
+	trig = viio_trigger_alloc(parent, fmt, vargs);
 	va_end(vargs);
 	if (trig) {
 		*ptr = trig;
-		devres_add(dev, ptr);
+		devres_add(parent, ptr);
 	} else {
 		devres_free(ptr);
 	}
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index f015fa185253..ee8dd1f7eb38 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -692,7 +692,7 @@  static inline void *iio_priv(const struct iio_dev *indio_dev)
 void iio_device_free(struct iio_dev *indio_dev);
 struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv);
 __printf(2, 3)
-struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
+struct iio_trigger *devm_iio_trigger_alloc(struct device *parent,
 					   const char *fmt, ...);
 /**
  * iio_buffer_enabled() - helper function to test if the buffer is enabled
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index 089e1961810c..f99b275c3810 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -161,7 +161,7 @@  void iio_trigger_poll_chained(struct iio_trigger *trig);
 
 irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
 
-__printf(2, 3) struct iio_trigger *iio_trigger_alloc(struct device *dev,
+__printf(2, 3) struct iio_trigger *iio_trigger_alloc(struct device *parent,
 						     const char *fmt, ...);
 void iio_trigger_free(struct iio_trigger *trig);