iio: event: Remove negative error code from iio_event_poll
authorCristina Opriceana <cristina.opriceana@gmail.com>
Mon, 3 Aug 2015 10:00:47 +0000 (13:00 +0300)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 28 Oct 2015 02:14:34 +0000 (22:14 -0400)
[ Upstream commit 41d903c00051d8f31c98a8136edbac67e6f8688f ]

Negative return values are not supported by iio_event_poll since
its return type is unsigned int.

Fixes: f18e7a068a0a3 ("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-event.c

index 35c02aeec75e31d1949ae58a6bb880f25f11881f..158a760ada12e5eb4c890d53fbc8ef2c1d7c1254 100644 (file)
@@ -84,7 +84,7 @@ static unsigned int iio_event_poll(struct file *filep,
        unsigned int events = 0;
 
        if (!indio_dev->info)
-               return -ENODEV;
+               return events;
 
        poll_wait(filep, &ev_int->wait, wait);