]> git.hungrycats.org Git - linux/commitdiff
iio: industrialio-buffer: Fix iio_buffer_poll return value
authorCristina Opriceana <cristina.opriceana@gmail.com>
Mon, 3 Aug 2015 10:37:40 +0000 (13:37 +0300)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 28 Oct 2015 02:14:35 +0000 (22:14 -0400)
[ Upstream commit 1bdc0293901cbea23c6dc29432e81919d4719844 ]

Change return value to 0 if no device is bound since
unsigned int cannot support negative error codes.

Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
device has been unregistered")

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/iio/industrialio-buffer.c

index f971f79103ecd9bf1cf74a279c2a24f96029e66d..25c68de393ad148eb36dc4bd5ed0a9476f7f1c4d 100644 (file)
@@ -93,7 +93,7 @@ unsigned int iio_buffer_poll(struct file *filp,
        struct iio_buffer *rb = indio_dev->buffer;
 
        if (!indio_dev->info)
-               return -ENODEV;
+               return 0;
 
        poll_wait(filp, &rb->pollq, wait);
        if (iio_buffer_data_available(rb))