Skip to content

Commit

Permalink
iio: core-trigger: make iio_device_register_trigger_consumer() an int…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
commodo authored and jic23 committed Mar 11, 2021
1 parent 8ebaa3f commit e64506b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion drivers/iio/iio_core_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
/**
* 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
*
* Return 0 if successful, negative otherwise
**/
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
Expand Down
4 changes: 3 additions & 1 deletion drivers/iio/industrialio-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,12 @@ int iio_trigger_validate_own_device(struct iio_trigger *trig,
}
EXPORT_SYMBOL(iio_trigger_validate_own_device);

void iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
int 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)
Expand Down

0 comments on commit e64506b

Please sign in to comment.