Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[firefly-linux-kernel-4.4.55.git] / drivers / char / nwbutton.c
index 1fd00dc0689721ae967af86aa2c88dbb903ddef2..76c490fa051103b99ba6b1006f7b8c2ed2a575a2 100644 (file)
@@ -168,7 +168,10 @@ static irqreturn_t button_handler (int irq, void *dev_id)
 static int button_read (struct file *filp, char __user *buffer,
                        size_t count, loff_t *ppos)
 {
-       interruptible_sleep_on (&button_wait_queue);
+       DEFINE_WAIT(wait);
+       prepare_to_wait(&button_wait_queue, &wait, TASK_INTERRUPTIBLE);
+       schedule();
+       finish_wait(&button_wait_queue, &wait);
        return (copy_to_user (buffer, &button_output_buffer, bcount))
                 ? -EFAULT : bcount;
 }