Commit b306122d authored by Ingo Korb's avatar Ingo Korb Committed by Linus Torvalds

Char: istallion, init+locking fixes

Move brdp->iosize assignment in stli_initecp up a few lines to stop the
driver from requesting an I/O region of length 0.

Remove spin_lock_irqsave/spin_unlock_irqrestore from __stli_sendcmd as
all users of that function take the lock already.
Signed-off-by: default avatarIngo Korb <ml@akana.de>
Cc: Jiri 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 186797ce
...@@ -2163,14 +2163,10 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne ...@@ -2163,14 +2163,10 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
cdkhdr_t __iomem *hdrp; cdkhdr_t __iomem *hdrp;
cdkctrl_t __iomem *cp; cdkctrl_t __iomem *cp;
unsigned char __iomem *bits; unsigned char __iomem *bits;
unsigned long flags;
spin_lock_irqsave(&brd_lock, flags);
if (test_bit(ST_CMDING, &portp->state)) { if (test_bit(ST_CMDING, &portp->state)) {
printk(KERN_ERR "STALLION: command already busy, cmd=%x!\n", printk(KERN_ERR "STALLION: command already busy, cmd=%x!\n",
(int) cmd); (int) cmd);
spin_unlock_irqrestore(&brd_lock, flags);
return; return;
} }
...@@ -2191,7 +2187,6 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne ...@@ -2191,7 +2187,6 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
writeb(readb(bits) | portp->portbit, bits); writeb(readb(bits) | portp->portbit, bits);
set_bit(ST_CMDING, &portp->state); set_bit(ST_CMDING, &portp->state);
EBRDDISABLE(brdp); EBRDDISABLE(brdp);
spin_unlock_irqrestore(&brd_lock, flags);
} }
static void stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback) static void stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback)
...@@ -3215,13 +3210,13 @@ static int stli_initecp(struct stlibrd *brdp) ...@@ -3215,13 +3210,13 @@ static int stli_initecp(struct stlibrd *brdp)
goto err; goto err;
} }
brdp->iosize = ECP_IOSIZE;
if (!request_region(brdp->iobase, brdp->iosize, "istallion")) { if (!request_region(brdp->iobase, brdp->iosize, "istallion")) {
retval = -EIO; retval = -EIO;
goto err; goto err;
} }
brdp->iosize = ECP_IOSIZE;
/* /*
* Based on the specific board type setup the common vars to access * Based on the specific board type setup the common vars to access
* and enable shared memory. Set all board specific information now * and enable shared memory. Set all board specific information now
......
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