aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2021-03-09 11:36:13 -0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-25 19:13:50 +0000
commit995071d36bb9804b644265450142fcb91c427ee8 (patch)
treeebe33a3eebf243584b57f7e584b874e6815112d8 /include
parentiio: adc: ad7124: allow more than 8 channels (diff)
downloadlinux-dev-995071d36bb9804b644265450142fcb91c427ee8.tar.xz
linux-dev-995071d36bb9804b644265450142fcb91c427ee8.zip
iio: set default trig->dev.parent
When allocated with [devm_]iio_trigger_alloc(), set trig device parent to the device the trigger is allocated for by default. It can always be reassigned in the probe routine. Change iio_trigger_alloc() API to add the device pointer to be coherent with devm_iio_trigger_alloc, using similar interface to iio_device_alloc(). Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210309193620.2176163-2-gwendal@chromium.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iio/iio.h2
-rw-r--r--include/linux/iio/trigger.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index f8585d01fc76..f2d65e2e88b6 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -693,7 +693,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 055890b6ffcf..096f68dd2e0c 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -161,7 +161,8 @@ void iio_trigger_poll_chained(struct iio_trigger *trig);
irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
-__printf(1, 2) struct iio_trigger *iio_trigger_alloc(const char *fmt, ...);
+__printf(2, 3)
+struct iio_trigger *iio_trigger_alloc(struct device *parent, const char *fmt, ...);
void iio_trigger_free(struct iio_trigger *trig);
/**