]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
staging:iio:triggers Remove unecessary existence checks and return val
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 26 Oct 2011 16:27:38 +0000 (17:27 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 00:30:30 +0000 (16:30 -0800)
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: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/iio_core_trigger.h
drivers/staging/iio/industrialio-trigger.c

index 523c288b776b15299e9b16028c9c0e8ce64c7566..6f7c56fcbe785efa8e018bb62b8d906c2fbec0db 100644 (file)
@@ -13,8 +13,7 @@
  * 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
  **/
-
-int iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
+void iio_device_register_trigger_consumer(struct iio_dev *indio_dev);
 
 /**
  * iio_device_unregister_trigger_consumer() - reverse the registration process
index 2c626e0cb29c33d192b95507a5f6440c8daf46d5..ca4124aa65eeac84a7422c6cc61f26e77390b421 100644 (file)
@@ -473,12 +473,10 @@ void iio_free_trigger(struct iio_trigger *trig)
 }
 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++] =
                &iio_trigger_consumer_attr_group;
-
-       return 0;
 }
 
 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)
 {
-       return indio_dev->trig
-               ? iio_trigger_attach_poll_func(indio_dev->trig,
-                                              indio_dev->pollfunc)
-               : 0;
+       return iio_trigger_attach_poll_func(indio_dev->trig,
+                                           indio_dev->pollfunc);
 }
 EXPORT_SYMBOL(iio_triggered_buffer_postenable);
 
 int iio_triggered_buffer_predisable(struct iio_dev *indio_dev)
 {
-       return indio_dev->trig
-               ? iio_trigger_dettach_poll_func(indio_dev->trig,
-                                               indio_dev->pollfunc)
-               : 0;
+       return iio_trigger_dettach_poll_func(indio_dev->trig,
+                                            indio_dev->pollfunc);
 }
 EXPORT_SYMBOL(iio_triggered_buffer_predisable);