From: Jason Dravet Add sysfs support to parport_pc. Without this patch parport_pc does not provide enough information to udev to create a /dev node. This eliminates the need to create the lp and parport nodes using /etc/udev/makedev.d. Signed-off-by: Jason Dravet Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/parport/parport_pc.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -puN drivers/parport/parport_pc.c~add-udev-support-to-parport_pc drivers/parport/parport_pc.c --- devel/drivers/parport/parport_pc.c~add-udev-support-to-parport_pc 2006-01-04 02:22:02.000000000 -0800 +++ devel-akpm/drivers/parport/parport_pc.c 2006-01-04 02:22:02.000000000 -0800 @@ -14,6 +14,7 @@ * More PCI support now conditional on CONFIG_PCI, 03/2001, Paul G. * Various hacks, Fred Barnes, 04/2001 * Updated probing logic - Adam Belay + * Added sysfs support, January 2, 2006 - Jason Dravet */ /* This driver should work with any hardware that is broadly compatible @@ -55,6 +56,7 @@ #include #include #include +#include #include #include @@ -99,6 +101,9 @@ static struct superio_struct { /* For Su int dma; } superios[NR_SUPERIOS] __devinitdata = { {0,},}; +static struct class *parallel_class; +int countports = 0; + static int user_specified; #if defined(CONFIG_PARPORT_PC_SUPERIO) || \ (defined(CONFIG_PARPORT_1284) && defined(CONFIG_PARPORT_PC_FIFO)) @@ -2232,6 +2237,11 @@ struct parport *parport_pc_probe_port (u is mandatory (see above) */ p->dma = PARPORT_DMA_NONE; + parallel_class = class_create(THIS_MODULE, "lp"); + class_device_create(parallel_class, NULL, MKDEV(6, countports), NULL, "lp%i", countports); + class_device_create(parallel_class, NULL, MKDEV(99, countports), NULL, "parport%i", countports); + countports++; + #ifdef CONFIG_PARPORT_PC_FIFO if (parport_ECP_supported(p) && p->dma != PARPORT_DMA_NOFIFO && @@ -3406,6 +3416,12 @@ static void __exit parport_pc_exit(void) if (pnp_registered_parport) pnp_unregister_driver (&parport_pc_pnp_driver); + for (countports--; countports >=0; countports--) { + class_device_destroy(parallel_class, MKDEV(99, countports)); + class_device_destroy(parallel_class, MKDEV(6, countports)); + } + class_destroy(parallel_class); + spin_lock(&ports_lock); while (!list_empty(&ports_list)) { struct parport_pc_private *priv; _