Messages in this thread Patch in this message | | | Date | Thu, 17 Feb 2000 14:59:13 +0000 (GMT) | From | Tim Waugh <> | Subject | lp.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/
| |