lkml.org 
[lkml]   [2000]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectlp.c devfs stuff
Here's a patch that moves the devfs_register call from lp_init to
lp_register. The point is that it's quite valid for lp to load before any
parallel port drivers.

Tim.
*/

Index: linux/drivers/char/lp.c
diff -u linux/drivers/char/lp.c:1.1.1.11 linux/drivers/char/lp.c:1.17
--- linux/drivers/char/lp.c:1.1.1.11 Thu Feb 17 10:04:41 2000
+++ linux/drivers/char/lp.c Thu Feb 17 14:48:34 2000
@@ -680,6 +680,8 @@

static int lp_register(int nr, struct parport *port)
{
+ char name[8];
+
lp_table[nr].dev = parport_register_device(port, "lp",
NULL, NULL, NULL, 0,
(void *) &lp_table[nr]);
@@ -690,6 +692,12 @@
if (reset)
lp_reset(nr);

+ sprintf (name, "%d", nr);
+ devfs_register (devfs_handle, name, 0,
+ DEVFS_FL_DEFAULT, LP_MAJOR, i,
+ S_IFCHR | S_IRUGO | S_IWUGO, 0, 0,
+ &lp_fops, NULL);
+
printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,
(port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");

@@ -787,20 +795,6 @@
}

devfs_handle = devfs_mk_dir (NULL, "printers", 0, NULL);
- if (lp_count) {
- for (i = 0; i < LP_NO; ++i)
- {
- char name[8];
-
- if (!(lp_table[i].flags & LP_EXIST))
- continue; /* skip this entry: it doesn't exist. */
- sprintf (name, "%d", i);
- devfs_register (devfs_handle, name, 0,
- DEVFS_FL_DEFAULT, LP_MAJOR, i,
- S_IFCHR | S_IRUGO | S_IWUGO, 0, 0,
- &lp_fops, NULL);
- }
- }

if (!lp_count) {
printk (KERN_INFO "lp: driver loaded but no devices found\n");

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.031 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site