Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: core-trigger: make iio_device_register_trigger_consumer() an int return

Oddly enough the noop function is an int-return. This one seems to be void.
This change converts it to int, because we want to change how groups are
registered. With that change this function could error out with -ENOMEM.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210215104043.91251-10-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Alexandru Ardelean and committed by
Jonathan Cameron
e64506bf 8ebaa3ff

+6 -2
+3 -1
drivers/iio/iio_core_trigger.h
··· 9 9 /** 10 10 * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers 11 11 * @indio_dev: iio_dev associated with the device that will consume the trigger 12 + * 13 + * Return 0 if successful, negative otherwise 12 14 **/ 13 - void iio_device_register_trigger_consumer(struct iio_dev *indio_dev); 15 + int iio_device_register_trigger_consumer(struct iio_dev *indio_dev); 14 16 15 17 /** 16 18 * iio_device_unregister_trigger_consumer() - reverse the registration process
+3 -1
drivers/iio/industrialio-trigger.c
··· 692 692 } 693 693 EXPORT_SYMBOL(iio_trigger_validate_own_device); 694 694 695 - void iio_device_register_trigger_consumer(struct iio_dev *indio_dev) 695 + int iio_device_register_trigger_consumer(struct iio_dev *indio_dev) 696 696 { 697 697 indio_dev->groups[indio_dev->groupcounter++] = 698 698 &iio_trigger_consumer_attr_group; 699 + 700 + return 0; 699 701 } 700 702 701 703 void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)