summaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/riotty.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-04-02 13:04:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-02 15:28:19 -0700
commit212e7bb6cda5dd3c4ad97a7aedef705028ced4ad (patch)
treef2257e37b2bd8e10c25be610c1648f627efaf525 /drivers/char/rio/riotty.c
parent3d0ae36ea973b42e1c636210433aebef4426c5bf (diff)
Char: rio, fix sparse warnings
Add some locks and unlocks to some code paths. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/rio/riotty.c')
-rw-r--r--drivers/char/rio/riotty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/rio/riotty.c b/drivers/char/rio/riotty.c
index a4f0b1e3e7f..cfa54361473 100644
--- a/drivers/char/rio/riotty.c
+++ b/drivers/char/rio/riotty.c
@@ -319,6 +319,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
PortP->State |= RIO_WOPEN;
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
/*
** ACTION: verify that this is a good thing
** to do here. -- ???
@@ -334,6 +335,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
func_exit();
return -EINTR;
}
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
}
PortP->State &= ~RIO_WOPEN;
}
@@ -493,6 +495,7 @@ int riotclose(void *ptr)
if (RIOShortCommand(p, PortP, CLOSE, 1, 0) == RIO_FAIL) {
RIOPreemptiveCmd(p, PortP, FCLOSE);
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
goto close_end;
}
@@ -508,6 +511,7 @@ int riotclose(void *ptr)
if (p->RIOHalted) {
RIOClearUp(PortP);
+ rio_spin_lock_irqsave(&PortP->portSem, flags);
goto close_end;
}
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {