Commit 67be8e32 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:triggers Remove unecessary existence checks and return val

Postenable and predisable are called via buffer->ops so  don't
need to check if buffer exists.

The return value of iio_device_register_trigger_consumer is
always zero and it isn't checked anyway so get rid of it.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 22dc09ca
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
* @indio_dev: iio_dev associated with the device that will consume the trigger * @indio_dev: iio_dev associated with the device that will consume the trigger
**/ **/
void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
/** /**
* iio_device_unregister_trigger_consumer() - reverse the registration process * iio_device_unregister_trigger_consumer() - reverse the registration process
......
...@@ -473,12 +473,10 @@ void iio_free_trigger(struct iio_trigger *trig) ...@@ -473,12 +473,10 @@ void iio_free_trigger(struct iio_trigger *trig)
} }
EXPORT_SYMBOL(iio_free_trigger); EXPORT_SYMBOL(iio_free_trigger);
int iio_device_register_trigger_consumer(struct iio_dev *indio_dev) void iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
{ {
indio_dev->groups[indio_dev->groupcounter++] = indio_dev->groups[indio_dev->groupcounter++] =
&iio_trigger_consumer_attr_group; &iio_trigger_consumer_attr_group;
return 0;
} }
void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev) void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
...@@ -490,18 +488,14 @@ void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev) ...@@ -490,18 +488,14 @@ void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
int iio_triggered_buffer_postenable(struct iio_dev *indio_dev) int iio_triggered_buffer_postenable(struct iio_dev *indio_dev)
{ {
return indio_dev->trig return iio_trigger_attach_poll_func(indio_dev->trig,
? iio_trigger_attach_poll_func(indio_dev->trig, indio_dev->pollfunc);
indio_dev->pollfunc)
: 0;
} }
EXPORT_SYMBOL(iio_triggered_buffer_postenable); EXPORT_SYMBOL(iio_triggered_buffer_postenable);
int iio_triggered_buffer_predisable(struct iio_dev *indio_dev) int iio_triggered_buffer_predisable(struct iio_dev *indio_dev)
{ {
return indio_dev->trig return iio_trigger_dettach_poll_func(indio_dev->trig,
? iio_trigger_dettach_poll_func(indio_dev->trig, indio_dev->pollfunc);
indio_dev->pollfunc)
: 0;
} }
EXPORT_SYMBOL(iio_triggered_buffer_predisable); EXPORT_SYMBOL(iio_triggered_buffer_predisable);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment