summaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /drivers/pnp
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/.cvsignore1
-rw-r--r--drivers/pnp/parport_probe.c36
2 files changed, 15 insertions, 22 deletions
diff --git a/drivers/pnp/.cvsignore b/drivers/pnp/.cvsignore
index 4671378ae..857dd22e9 100644
--- a/drivers/pnp/.cvsignore
+++ b/drivers/pnp/.cvsignore
@@ -1 +1,2 @@
.depend
+.*.flags
diff --git a/drivers/pnp/parport_probe.c b/drivers/pnp/parport_probe.c
index 836d1aa66..8b735fb52 100644
--- a/drivers/pnp/parport_probe.c
+++ b/drivers/pnp/parport_probe.c
@@ -58,7 +58,11 @@ static long read_polled(struct parport *port, char *buf,
for (i=0; ; i++) {
parport_write_control(port, parport_read_control(port) | 2); /* AutoFeed high */
if (parport_wait_peripheral(port, 0x40, 0)) {
+#ifdef DEBUG_PROBE
+ /* Some peripherals just time out when they've sent
+ all their data. */
printk("%s: read1 timeout.\n", port->name);
+#endif
parport_write_control(port, parport_read_control(port) & ~2);
break;
}
@@ -68,36 +72,26 @@ static long read_polled(struct parport *port, char *buf,
printk("%s: read2 timeout.\n", port->name);
break;
}
- if (( i & 1) != 0) {
- Byte= (Byte | z<<4);
+ if ((i & 1) != 0) {
+ Byte |= (z<<4);
if (temp)
*(temp++) = Byte;
if (count++ == length)
temp = NULL;
/* Does the error line indicate end of data? */
- if ((parport_read_status(port) & LP_PERRORP) == LP_PERRORP)
+ if ((parport_read_status(port) & LP_PERRORP) ==
+ LP_PERRORP)
break;
- } else Byte=z;
+ } else
+ Byte=z;
}
read_terminate(port);
return count;
}
-static struct wait_queue *wait_q;
-
-static void wakeup(void *ref)
-{
- struct pardevice **dev = (struct pardevice **)ref;
-
- if (!waitqueue_active || parport_claim(*dev))
- return;
-
- wake_up(&wait_q);
-}
-
int parport_probe(struct parport *port, char *buffer, int len)
{
- struct pardevice *dev = parport_register_device(port, "IEEE 1284 probe", NULL, wakeup, NULL, PARPORT_DEV_TRAN, &dev);
+ struct pardevice *dev = parport_register_device(port, "IEEE 1284 probe", NULL, NULL, NULL, PARPORT_DEV_TRAN, &dev);
int result = 0;
@@ -106,9 +100,7 @@ int parport_probe(struct parport *port, char *buffer, int len)
return -EINVAL;
}
- init_waitqueue (&wait_q);
- if (parport_claim(dev))
- sleep_on(&wait_q);
+ parport_claim_or_block(dev);
switch (parport_ieee1284_nibble_mode_ok(port, 4)) {
case 1:
@@ -233,6 +225,7 @@ void parport_probe_one(struct parport *port)
char *buffer = kmalloc(2048, GFP_KERNEL);
int r;
+ MOD_INC_USE_COUNT;
port->probe_info.model = "Unknown device";
port->probe_info.mfr = "Unknown vendor";
port->probe_info.description = NULL;
@@ -261,17 +254,16 @@ void parport_probe_one(struct parport *port)
pretty_print(port);
}
kfree(buffer);
+ MOD_DEC_USE_COUNT;
}
#if MODULE
int init_module(void)
{
struct parport *p;
- MOD_INC_USE_COUNT;
for (p = parport_enumerate(); p; p = p->next)
parport_probe_one(p);
parport_probe_hook = &parport_probe_one;
- MOD_DEC_USE_COUNT;
return 0;
}