X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Finput%2Fserio%2Fi8042-x86ia64io.h;fp=drivers%2Finput%2Fserio%2Fi8042-x86ia64io.h;h=a4c6f352272390af0d2d8b740d53a1bb8cd2668d;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=f606e96bc2f4b5e4f5e04f22f0440c94c3453607;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index f606e96bc..a4c6f3522 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -192,9 +192,7 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { #include static int i8042_pnp_kbd_registered; -static unsigned int i8042_pnp_kbd_devices; static int i8042_pnp_aux_registered; -static unsigned int i8042_pnp_aux_devices; static int i8042_pnp_command_reg; static int i8042_pnp_data_reg; @@ -221,7 +219,6 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id * strncat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name)); } - i8042_pnp_kbd_devices++; return 0; } @@ -242,7 +239,6 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id * strncat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name)); } - i8042_pnp_aux_devices++; return 0; } @@ -291,23 +287,21 @@ static void i8042_pnp_exit(void) static int __init i8042_pnp_init(void) { + int result_kbd = 0, result_aux = 0; char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 }; - int err; if (i8042_nopnp) { printk(KERN_INFO "i8042: PNP detection disabled\n"); return 0; } - err = pnp_register_driver(&i8042_pnp_kbd_driver); - if (!err) + if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0) i8042_pnp_kbd_registered = 1; - err = pnp_register_driver(&i8042_pnp_aux_driver); - if (!err) + if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0) i8042_pnp_aux_registered = 1; - if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) { + if (result_kbd <= 0 && result_aux <= 0) { i8042_pnp_exit(); #if defined(__ia64__) return -ENODEV; @@ -317,24 +311,24 @@ static int __init i8042_pnp_init(void) #endif } - if (i8042_pnp_kbd_devices) + if (result_kbd > 0) snprintf(kbd_irq_str, sizeof(kbd_irq_str), "%d", i8042_pnp_kbd_irq); - if (i8042_pnp_aux_devices) + if (result_aux > 0) snprintf(aux_irq_str, sizeof(aux_irq_str), "%d", i8042_pnp_aux_irq); printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n", - i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "", + i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "", i8042_pnp_aux_name, i8042_pnp_data_reg, i8042_pnp_command_reg, - kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "", + kbd_irq_str, (result_kbd > 0 && result_aux > 0) ? "," : "", aux_irq_str); #if defined(__ia64__) - if (!i8042_pnp_kbd_devices) + if (result_kbd <= 0) i8042_nokbd = 1; - if (!i8042_pnp_aux_devices) + if (result_aux <= 0) i8042_noaux = 1; #endif