X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Flp.c;h=81674d7c56c7e74c655e62bb86f2d20cc350aae3;hb=444ad82bc3eaa554be40d22dc248e58aeefd54d9;hp=62051f8b0910cb97c04fc58e364f0996437c60be;hpb=2c4f365ad2361c93c097e958b2b0a7a112750228;p=linux-2.6 diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 62051f8b09..81674d7c56 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -144,7 +144,7 @@ static unsigned int lp_count = 0; static struct class *lp_class; #ifdef CONFIG_LP_CONSOLE -static struct parport *console_registered; // initially NULL +static struct parport *console_registered; #endif /* CONFIG_LP_CONSOLE */ #undef LP_DEBUG @@ -749,8 +749,8 @@ static struct console lpcons = { /* --- initialisation code ------------------------------------- */ static int parport_nr[LP_NO] = { [0 ... LP_NO-1] = LP_PARPORT_UNSPEC }; -static char *parport[LP_NO] = { NULL, }; -static int reset = 0; +static char *parport[LP_NO]; +static int reset; module_param_array(parport, charp, NULL, 0); module_param(reset, bool, 0); @@ -758,10 +758,10 @@ module_param(reset, bool, 0); #ifndef MODULE static int __init lp_setup (char *str) { - static int parport_ptr; // initially zero + static int parport_ptr; int x; - if (get_option (&str, &x)) { + if (get_option(&str, &x)) { if (x == 0) { /* disable driver on "lp=" or "lp=0" */ parport_nr[0] = LP_PARPORT_OFF; @@ -799,8 +799,7 @@ static int lp_register(int nr, struct parport *port) if (reset) lp_reset(nr); - class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), port->dev, - "lp%d", nr); + device_create(lp_class, port->dev, MKDEV(LP_MAJOR, nr), "lp%d", nr); printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven"); @@ -808,7 +807,7 @@ static int lp_register(int nr, struct parport *port) #ifdef CONFIG_LP_CONSOLE if (!nr) { if (port->modes & PARPORT_MODE_SAFEININT) { - register_console (&lpcons); + register_console(&lpcons); console_registered = port; printk (KERN_INFO "lp%d: console ready\n", CONSOLE_LP); } else @@ -824,8 +823,7 @@ static void lp_attach (struct parport *port) { unsigned int i; - switch (parport_nr[0]) - { + switch (parport_nr[0]) { case LP_PARPORT_UNSPEC: case LP_PARPORT_AUTO: if (parport_nr[0] == LP_PARPORT_AUTO && @@ -856,7 +854,7 @@ static void lp_detach (struct parport *port) /* Write this some day. */ #ifdef CONFIG_LP_CONSOLE if (console_registered == port) { - unregister_console (&lpcons); + unregister_console(&lpcons); console_registered = NULL; } #endif /* CONFIG_LP_CONSOLE */ @@ -971,7 +969,7 @@ static void lp_cleanup_module (void) if (lp_table[offset].dev == NULL) continue; parport_unregister_device(lp_table[offset].dev); - class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset)); + device_destroy(lp_class, MKDEV(LP_MAJOR, offset)); } class_destroy(lp_class); }