aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIngo Korb <ml@akana.de>2007-07-17 07:05:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:10 -0400
commitb306122df9f9dbec7751133073b4d19b9197d22e (patch)
tree4f580370b4c025f3b6136ca15a2d8338bbbf27d6 /drivers
parent186797ce330867b4c3609e503d2fee2fc6940954 (diff)
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: Ingo Korb <ml@akana.de> Cc: 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')
-rw-r--r--drivers/char/istallion.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 809409922996..3c66f402f9d7 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -2163,14 +2163,10 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
2163 cdkhdr_t __iomem *hdrp; 2163 cdkhdr_t __iomem *hdrp;
2164 cdkctrl_t __iomem *cp; 2164 cdkctrl_t __iomem *cp;
2165 unsigned char __iomem *bits; 2165 unsigned char __iomem *bits;
2166 unsigned long flags;
2167
2168 spin_lock_irqsave(&brd_lock, flags);
2169 2166
2170 if (test_bit(ST_CMDING, &portp->state)) { 2167 if (test_bit(ST_CMDING, &portp->state)) {
2171 printk(KERN_ERR "STALLION: command already busy, cmd=%x!\n", 2168 printk(KERN_ERR "STALLION: command already busy, cmd=%x!\n",
2172 (int) cmd); 2169 (int) cmd);
2173 spin_unlock_irqrestore(&brd_lock, flags);
2174 return; 2170 return;
2175 } 2171 }
2176 2172
@@ -2191,7 +2187,6 @@ static void __stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigne
2191 writeb(readb(bits) | portp->portbit, bits); 2187 writeb(readb(bits) | portp->portbit, bits);
2192 set_bit(ST_CMDING, &portp->state); 2188 set_bit(ST_CMDING, &portp->state);
2193 EBRDDISABLE(brdp); 2189 EBRDDISABLE(brdp);
2194 spin_unlock_irqrestore(&brd_lock, flags);
2195} 2190}
2196 2191
2197static void stli_sendcmd(struct stlibrd *brdp, struct stliport *portp, unsigned long cmd, void *arg, int size, int copyback) 2192static 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 goto err; 3210 goto err;
3216 } 3211 }
3217 3212
3213 brdp->iosize = ECP_IOSIZE;
3214
3218 if (!request_region(brdp->iobase, brdp->iosize, "istallion")) { 3215 if (!request_region(brdp->iobase, brdp->iosize, "istallion")) {
3219 retval = -EIO; 3216 retval = -EIO;
3220 goto err; 3217 goto err;
3221 } 3218 }
3222 3219
3223 brdp->iosize = ECP_IOSIZE;
3224
3225/* 3220/*
3226 * Based on the specific board type setup the common vars to access 3221 * Based on the specific board type setup the common vars to access
3227 * and enable shared memory. Set all board specific information now 3222 * and enable shared memory. Set all board specific information now