Commit c3d31e7f9a94800ba895a081e143e79954f6c62f

Authored by Dmitry Torokhov
1 parent 8d5987a6e1

Input: i8042 - fix IRQ printing when either KBD or AUX port

is absent from ACPI/PNP tables.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Showing 1 changed file with 25 additions and 14 deletions Side-by-side Diff

drivers/input/serio/i8042-x86ia64io.h
... ... @@ -258,7 +258,8 @@
258 258  
259 259 static int __init i8042_pnp_init(void)
260 260 {
261   - int result_kbd, result_aux;
  261 + int result_kbd = 0, result_aux = 0;
  262 + char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
262 263  
263 264 if (i8042_nopnp) {
264 265 printk(KERN_INFO "i8042: PNP detection disabled\n");
... ... @@ -267,6 +268,7 @@
267 268  
268 269 if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0)
269 270 i8042_pnp_kbd_registered = 1;
  271 +
270 272 if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0)
271 273 i8042_pnp_aux_registered = 1;
272 274  
... ... @@ -280,6 +282,25 @@
280 282 #endif
281 283 }
282 284  
  285 + if (result_kbd > 0)
  286 + snprintf(kbd_irq_str, sizeof(kbd_irq_str),
  287 + "%d", i8042_pnp_kbd_irq);
  288 + if (result_aux > 0)
  289 + snprintf(aux_irq_str, sizeof(aux_irq_str),
  290 + "%d", i8042_pnp_aux_irq);
  291 +
  292 + printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
  293 + i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "",
  294 + i8042_pnp_aux_name,
  295 + i8042_pnp_data_reg, i8042_pnp_command_reg,
  296 + kbd_irq_str, (result_kbd > 0 && result_aux > 0) ? "," : "",
  297 + aux_irq_str);
  298 +
  299 +#if defined(__ia64__)
  300 + if (result_aux <= 0)
  301 + i8042_noaux = 1;
  302 +#endif
  303 +
283 304 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
284 305 i8042_pnp_data_reg != i8042_data_reg) || !i8042_pnp_data_reg) {
285 306 printk(KERN_WARNING "PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
286 307  
287 308  
288 309  
... ... @@ -295,29 +316,19 @@
295 316 }
296 317  
297 318 if (!i8042_pnp_kbd_irq) {
298   - printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %#x\n", i8042_kbd_irq);
  319 + printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %d\n", i8042_kbd_irq);
299 320 i8042_pnp_kbd_irq = i8042_kbd_irq;
300 321 }
301 322  
302   - if (!i8042_pnp_aux_irq) {
303   - printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %#x\n", i8042_aux_irq);
  323 + if (!i8042_noaux && !i8042_pnp_aux_irq) {
  324 + printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %d\n", i8042_aux_irq);
304 325 i8042_pnp_aux_irq = i8042_aux_irq;
305 326 }
306 327  
307   -#if defined(__ia64__)
308   - if (result_aux <= 0)
309   - i8042_noaux = 1;
310   -#endif
311   -
312 328 i8042_data_reg = i8042_pnp_data_reg;
313 329 i8042_command_reg = i8042_pnp_command_reg;
314 330 i8042_kbd_irq = i8042_pnp_kbd_irq;
315 331 i8042_aux_irq = i8042_pnp_aux_irq;
316   -
317   - printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %d%s%d\n",
318   - i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "", i8042_pnp_aux_name,
319   - i8042_data_reg, i8042_command_reg, i8042_kbd_irq,
320   - (result_aux > 0) ? "," : "", i8042_aux_irq);
321 332  
322 333 return 0;
323 334 }