提交 329fddd7 编写于 作者: A Arnd Bergmann 提交者: Jesper Nilsson

cris: sync_serial: remove interruptible_sleep_on

sleep_on and its variants are racy and going away. This replaces
the two uses in the cris sync_serial drivers with the equivalent
but race-free wait_event_interruptible.
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Signed-off-by: NJesper Nilsson <jespern@axis.com>
上级 64d8ad93
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/wait.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf, ...@@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf,
if (file->f_flags & O_NONBLOCK) if (file->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
interruptible_sleep_on(&port->in_wait_q); wait_event_interruptible(port->in_wait_q,
!(start == end && !port->full));
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/wait.h>
#include <asm/io.h> #include <asm/io.h>
#include <dma.h> #include <dma.h>
...@@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf, ...@@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf,
if (file->f_flags & O_NONBLOCK) if (file->f_flags & O_NONBLOCK)
return -EAGAIN; return -EAGAIN;
interruptible_sleep_on(&port->in_wait_q); wait_event_interruptible(port->in_wait_q,
!(start == end && !port->full));
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册