mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
iio: Make return value check for set_trigger_state() consistent
In `iio_trigger_detach_poll_func()` the return value from `trig->ops->set_trigger_state(trig, false)` is checked with `if (ret)`. However, in `iio_trigger_attach_poll_func()` it is checked with `if (ret < 0)`. Resolve this mismatch by only checking for `if (ret)` in both places. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://lore.kernel.org/r/pndv8eojdey.fsf@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
b7297d4566
commit
4dc8f99dab
@ -313,7 +313,7 @@ int iio_trigger_attach_poll_func(struct iio_trigger *trig,
|
||||
/* Enable trigger in driver */
|
||||
if (trig->ops && trig->ops->set_trigger_state && notinuse) {
|
||||
ret = trig->ops->set_trigger_state(trig, true);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
goto out_free_irq;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user