aboutsummaryrefslogtreecommitdiff
path: root/include/linux/iio
diff options
context:
space:
mode:
authorGregor Boirie2016-09-02 20:47:54 +0200
committerJonathan Cameron2016-09-04 15:42:37 +0100
commit9083325f1197a6956db17809d74dbe3578dc1005 (patch)
tree564e82838791d03d37e79ee737aaae5e36a656aa /include/linux/iio
parent2535cc7ae02bc1e4dc6b6d3771ba8d18cd824e10 (diff)
iio:trigger: add resource managed (un)register
Add resource managed devm_iio_trigger_register() and devm_iio_triger_unregister() to automatically clean up registered triggers allocated by IIO drivers, thus leading to simplified IIO drivers code. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
-rw-r--r--include/linux/iio/trigger.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index a122bdd4076c..f0890a5abf13 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -125,12 +125,18 @@ static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)
**/
int iio_trigger_register(struct iio_trigger *trig_info);
+int devm_iio_trigger_register(struct device *dev,
+ struct iio_trigger *trig_info);
+
/**
* iio_trigger_unregister() - unregister a trigger from the core
* @trig_info: trigger to be unregistered
**/
void iio_trigger_unregister(struct iio_trigger *trig_info);
+void devm_iio_trigger_unregister(struct device *dev,
+ struct iio_trigger *trig_info);
+
/**
* iio_trigger_set_immutable() - set an immutable trigger on destination
*