summaryrefslogtreecommitdiffstats
path: root/drivers/misc/parport_share.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /drivers/misc/parport_share.c
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'drivers/misc/parport_share.c')
-rw-r--r--drivers/misc/parport_share.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/misc/parport_share.c b/drivers/misc/parport_share.c
index bd0ae3c8b..7da49fae4 100644
--- a/drivers/misc/parport_share.c
+++ b/drivers/misc/parport_share.c
@@ -1,4 +1,4 @@
-/* $Id: parport_share.c,v 1.11 1998/03/26 10:38:32 ralf Exp $
+/* $Id: parport_share.c,v 1.14 1998/05/04 19:05:05 ralf Exp $
* Parallel-port resource manager code.
*
* Authors: David Campbell <campbell@tirian.che.curtin.edu.au>
@@ -34,7 +34,7 @@
#undef PARPORT_PARANOID
-#define PARPORT_DEFAULT_TIMESLICE (HZ/10)
+#define PARPORT_DEFAULT_TIMESLICE (HZ/5)
static struct parport *portlist = NULL, *portlist_tail = NULL;
static int portcount = 0;
@@ -398,6 +398,7 @@ void parport_release(struct pardevice *dev)
{
struct parport *port = dev->port;
struct pardevice *pd;
+ unsigned long flags;
/* Make sure that dev is the current device */
if (port->cad != dev) {
@@ -405,7 +406,9 @@ void parport_release(struct pardevice *dev)
"when not owner\n", port->name, dev->name);
return;
}
+ spin_lock_irqsave(&port->lock, flags);
port->cad = NULL;
+ spin_unlock_irqrestore(&port->lock, flags);
/* Save control registers */
port->ops->save_state(port, dev->state);
@@ -441,3 +444,24 @@ void parport_release(struct pardevice *dev)
pd->wakeup(pd->private);
}
}
+
+void parport_parse_irqs(int nports, const char *irqstr[], int irqval[])
+{
+ unsigned int i;
+ for (i = 0; i < nports && irqstr[i]; i++) {
+ if (!strncmp(irqstr[i], "auto", 4))
+ irqval[i] = PARPORT_IRQ_AUTO;
+ else if (!strncmp(irqstr[i], "none", 4))
+ irqval[i] = PARPORT_IRQ_NONE;
+ else {
+ char *ep;
+ unsigned long r = simple_strtoul(irqstr[i], &ep, 0);
+ if (ep != irqstr[i])
+ irqval[i] = r;
+ else {
+ printk("parport: bad irq specifier `%s'\n", irqstr[i]);
+ return;
+ }
+ }
+ }
+}