iio: percolate error if event fd fails
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 11 Aug 2015 09:56:40 +0000 (11:56 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 16 Aug 2015 09:51:26 +0000 (10:51 +0100)
commit3f9059b71791cf0e57a4879594f0066237976943
treec0209f19fefdc8fa41b23ab201324df3ef2794f8
parent53dabafe1b17411de82b6c4560145cf396cbb564
iio: percolate error if event fd fails

This makes the error from iio_event_getfd() percolate up
to userspace properly so we can know for sure there is no
events on this device (-ENODEV returned). Before this patch
we would bail out looking for the unsupported events on the
erroneous (negative) file descriptor.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-core.c