patch-2.3.6 linux/drivers/misc/parport_share.c
Next file: linux/drivers/net/3c515.c
Previous file: linux/drivers/misc/parport_procfs.c
Back to the patch index
Back to the overall index
- Lines: 91
- Date:
Mon Jun 7 14:49:23 1999
- Orig file:
v2.3.5/linux/drivers/misc/parport_share.c
- Orig date:
Wed Jun 2 14:44:39 1999
diff -u --recursive --new-file v2.3.5/linux/drivers/misc/parport_share.c linux/drivers/misc/parport_share.c
@@ -39,6 +39,11 @@
#define PARPORT_DEFAULT_TIMESLICE (HZ/5)
+unsigned long parport_default_timeslice = PARPORT_DEFAULT_TIMESLICE;
+
+/* This doesn't do anything yet. */
+int parport_default_spintime;
+
static struct parport *portlist = NULL, *portlist_tail = NULL;
spinlock_t parportlist_lock = SPIN_LOCK_UNLOCKED;
@@ -231,25 +236,6 @@
kfree(port);
}
-void parport_quiesce(struct parport *port)
-{
- if (port->devices) {
- printk(KERN_WARNING "%s: attempt to quiesce active port.\n",
- port->name);
- return;
- }
-
- if (port->flags & PARPORT_FLAG_COMA) {
- printk(KERN_WARNING "%s: attempt to quiesce comatose port.\n",
- port->name);
- return;
- }
-
- port->ops->release_resources(port);
-
- port->flags |= PARPORT_FLAG_COMA;
-}
-
struct pardevice *parport_register_device(struct parport *port, const char *name,
int (*pf)(void *), void (*kf)(void *),
void (*irq_func)(int, void *, struct pt_regs *),
@@ -284,19 +270,6 @@
return NULL;
}
- /* We may need to claw back the port hardware. */
- if (port->flags & PARPORT_FLAG_COMA) {
- if (port->ops->claim_resources(port)) {
- printk(KERN_WARNING
- "%s: unable to get hardware to register %s.\n",
- port->name, name);
- kfree (tmp->state);
- kfree (tmp);
- return NULL;
- }
- port->flags &= ~PARPORT_FLAG_COMA;
- }
-
tmp->name = name;
tmp->port = port;
tmp->preempt = pf;
@@ -338,7 +311,7 @@
port->ops->inc_use_count();
init_waitqueue_head(&tmp->wait_q);
- tmp->timeslice = PARPORT_DEFAULT_TIMESLICE;
+ tmp->timeslice = parport_default_timeslice;
tmp->waitnext = tmp->waitprev = NULL;
return tmp;
@@ -358,9 +331,9 @@
port = dev->port;
if (port->cad == dev) {
- printk(KERN_WARNING "%s: refused to unregister "
- "currently active device %s.\n", port->name, dev->name);
- return;
+ printk(KERN_DEBUG "%s: %s forgot to release port\n",
+ port->name, dev->name);
+ parport_release (dev);
}
spin_lock(&port->pardevice_lock);
@@ -381,10 +354,6 @@
dec_parport_count();
port->ops->dec_use_count();
-
- /* If there are no more devices, put the port to sleep. */
- if (!port->devices)
- parport_quiesce(port);
return;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)