Commit 212e7bb6 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

Char: rio, fix sparse warnings

Add some locks and unlocks to some code paths.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d0ae36e
...@@ -425,8 +425,10 @@ int RIOApel(struct rio_info *p) ...@@ -425,8 +425,10 @@ int RIOApel(struct rio_info *p)
MapP = &p->RIOConnectTable[Next++]; MapP = &p->RIOConnectTable[Next++];
MapP->HostUniqueNum = HostP->UniqueNum; MapP->HostUniqueNum = HostP->UniqueNum;
if ((HostP->Flags & RUN_STATE) != RC_RUNNING) if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
continue; continue;
}
MapP->RtaUniqueNum = 0; MapP->RtaUniqueNum = 0;
MapP->ID = 0; MapP->ID = 0;
MapP->Flags = SLOT_IN_USE; MapP->Flags = SLOT_IN_USE;
......
...@@ -319,6 +319,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -319,6 +319,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
PortP->State |= RIO_WOPEN; PortP->State |= RIO_WOPEN;
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
rio_spin_lock_irqsave(&PortP->portSem, flags);
/* /*
** ACTION: verify that this is a good thing ** ACTION: verify that this is a good thing
** to do here. -- ??? ** to do here. -- ???
...@@ -334,6 +335,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -334,6 +335,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
func_exit(); func_exit();
return -EINTR; return -EINTR;
} }
rio_spin_lock_irqsave(&PortP->portSem, flags);
} }
PortP->State &= ~RIO_WOPEN; PortP->State &= ~RIO_WOPEN;
} }
...@@ -493,6 +495,7 @@ int riotclose(void *ptr) ...@@ -493,6 +495,7 @@ int riotclose(void *ptr)
if (RIOShortCommand(p, PortP, CLOSE, 1, 0) == RIO_FAIL) { if (RIOShortCommand(p, PortP, CLOSE, 1, 0) == RIO_FAIL) {
RIOPreemptiveCmd(p, PortP, FCLOSE); RIOPreemptiveCmd(p, PortP, FCLOSE);
rio_spin_lock_irqsave(&PortP->portSem, flags);
goto close_end; goto close_end;
} }
...@@ -508,6 +511,7 @@ int riotclose(void *ptr) ...@@ -508,6 +511,7 @@ int riotclose(void *ptr)
if (p->RIOHalted) { if (p->RIOHalted) {
RIOClearUp(PortP); RIOClearUp(PortP);
rio_spin_lock_irqsave(&PortP->portSem, flags);
goto close_end; goto close_end;
} }
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment