diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-01-02 07:07:37 -0500 |
---|---|---|
committer | Jesper Nilsson <jespern@axis.com> | 2014-01-09 04:50:50 -0500 |
commit | 329fddd7b60cf6aed53cdb6fdc8e64117b8e8bc6 (patch) | |
tree | 7e4e54cfa9defbb96c73bad6ec49c0d391a6ba43 /arch/cris | |
parent | 64d8ad933d06f3d5070db8eb855cdfc0a80b595d (diff) |
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: Arnd Bergmann <arnd@arndb.de>
Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Signed-off-by: Jesper Nilsson <jespern@axis.com>
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/drivers/sync_serial.c | 4 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index 04d39e0ca55d..29eb02ab3f25 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | #include <linux/wait.h> | ||
25 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
26 | #include <asm/dma.h> | 27 | #include <asm/dma.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
@@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf, | |||
1136 | if (file->f_flags & O_NONBLOCK) | 1137 | if (file->f_flags & O_NONBLOCK) |
1137 | return -EAGAIN; | 1138 | return -EAGAIN; |
1138 | 1139 | ||
1139 | interruptible_sleep_on(&port->in_wait_q); | 1140 | wait_event_interruptible(port->in_wait_q, |
1141 | !(start == end && !port->full)); | ||
1140 | if (signal_pending(current)) | 1142 | if (signal_pending(current)) |
1141 | return -EINTR; | 1143 | return -EINTR; |
1142 | 1144 | ||
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 219f704e3221..bbb806b68838 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/wait.h> | ||
22 | 23 | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <dma.h> | 25 | #include <dma.h> |
@@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf, | |||
1144 | if (file->f_flags & O_NONBLOCK) | 1145 | if (file->f_flags & O_NONBLOCK) |
1145 | return -EAGAIN; | 1146 | return -EAGAIN; |
1146 | 1147 | ||
1147 | interruptible_sleep_on(&port->in_wait_q); | 1148 | wait_event_interruptible(port->in_wait_q, |
1149 | !(start == end && !port->full)); | ||
1148 | if (signal_pending(current)) | 1150 | if (signal_pending(current)) |
1149 | return -EINTR; | 1151 | return -EINTR; |
1150 | 1152 | ||