summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/v4l1-compat.c4
-rw-r--r--v4l/compat.h8
2 files changed, 9 insertions, 3 deletions
diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c
index 14b559b16..4a4cb4c57 100644
--- a/linux/drivers/media/video/v4l1-compat.c
+++ b/linux/drivers/media/video/v4l1-compat.c
@@ -204,7 +204,6 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
table = &pwq->pt;
for (;;) {
int mask;
- set_current_state(TASK_INTERRUPTIBLE);
mask = file->f_op->poll(file, table);
if (mask & POLLIN)
break;
@@ -213,9 +212,8 @@ static int poll_one(struct file *file, struct poll_wqueues *pwq)
retval = -ERESTARTSYS;
break;
}
- schedule();
+ poll_schedule(pwq, TASK_INTERRUPTIBLE);
}
- set_current_state(TASK_RUNNING);
poll_freewait(pwq);
return retval;
}
diff --git a/v4l/compat.h b/v4l/compat.h
index 186493d7f..b00e8eaf3 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -412,5 +412,13 @@ static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
pci_resource_len(pdev, bar))
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+#define poll_schedule(pwq, task) \
+ do { \
+ set_current_state(task); \
+ schedule(); \
+ set_current_state(TASK_RUNNING); \
+ } while (0)
+#endif
#endif