Merge tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / iio / industrialio-event.c
index 894d8137c4cfaf7a7b0deddfc407a550045ca3c9..cae332b1d7ea595959c53ecb3c8f51eef9ba095b 100644 (file)
@@ -32,6 +32,7 @@
  * @dev_attr_list:     list of event interface sysfs attribute
  * @flags:             file operations related flags including busy flag.
  * @group:             event interface sysfs attribute group
+ * @read_lock:         lock to protect kfifo read operations
  */
 struct iio_event_interface {
        wait_queue_head_t       wait;
@@ -75,6 +76,11 @@ EXPORT_SYMBOL(iio_push_event);
 
 /**
  * iio_event_poll() - poll the event queue to find out if it has data
+ * @filep:     File structure pointer to identify the device
+ * @wait:      Poll table pointer to add the wait queue on
+ *
+ * Return: (POLLIN | POLLRDNORM) if data is available for reading
+ *        or a negative error code on failure
  */
 static unsigned int iio_event_poll(struct file *filep,
                             struct poll_table_struct *wait)
@@ -84,7 +90,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);