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)
committerJonathan Cameron <jic23@kernel.org>
Wed, 12 Aug 2015 18:26:34 +0000 (19:26 +0100)
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>
drivers/iio/industrialio-buffer.c

index faed6efa49ec3d394de7bf29ba9d411bf037d357..d7e908acb48020b3f5390030e5a3687b03ba9878 100644 (file)
@@ -164,7 +164,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_ready(indio_dev, rb, rb->watermark, 0))
This page took 0.027414 seconds and 5 git commands to generate.