]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2015 17:05:27 +0000 (10:05 -0700)
commit 1bdc0293901cbea23c6dc29432e81919d4719844 upstream.

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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-buffer.c

index df919f44d513f466a0caa4f870d956273007531f..7fa280b28ecb70101d7d9693f0aa623225e5f037 100644 (file)
@@ -151,7 +151,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))