diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-01-07 02:51:47 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-01-07 02:54:32 -0500 |
commit | a9a1f9c315c27fe7a260cd453167981cd680dae8 (patch) | |
tree | da6a4cc5cb0b69739348939d5771dc0976fda426 | |
parent | 3032458e38b583c92842818871e85c0f936b8645 (diff) |
Input: atkbd - switch to dev_err() and friends
dev_err(), dev_warn() and dev_dbg() ensure consistency in driver messages.
Also switch to using bool where appropriate and fix some formatting issues.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 283 |
1 files changed, 146 insertions, 137 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index a3573570c52..7c235013dba 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -40,26 +40,26 @@ module_param_named(set, atkbd_set, int, 0); | |||
40 | MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3 = PS/2 native)"); | 40 | MODULE_PARM_DESC(set, "Select keyboard code set (2 = default, 3 = PS/2 native)"); |
41 | 41 | ||
42 | #if defined(__i386__) || defined(__x86_64__) || defined(__hppa__) | 42 | #if defined(__i386__) || defined(__x86_64__) || defined(__hppa__) |
43 | static int atkbd_reset; | 43 | static bool atkbd_reset; |
44 | #else | 44 | #else |
45 | static int atkbd_reset = 1; | 45 | static bool atkbd_reset = true; |
46 | #endif | 46 | #endif |
47 | module_param_named(reset, atkbd_reset, bool, 0); | 47 | module_param_named(reset, atkbd_reset, bool, 0); |
48 | MODULE_PARM_DESC(reset, "Reset keyboard during initialization"); | 48 | MODULE_PARM_DESC(reset, "Reset keyboard during initialization"); |
49 | 49 | ||
50 | static int atkbd_softrepeat; | 50 | static bool atkbd_softrepeat; |
51 | module_param_named(softrepeat, atkbd_softrepeat, bool, 0); | 51 | module_param_named(softrepeat, atkbd_softrepeat, bool, 0); |
52 | MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat"); | 52 | MODULE_PARM_DESC(softrepeat, "Use software keyboard repeat"); |
53 | 53 | ||
54 | static int atkbd_softraw = 1; | 54 | static bool atkbd_softraw = true; |
55 | module_param_named(softraw, atkbd_softraw, bool, 0); | 55 | module_param_named(softraw, atkbd_softraw, bool, 0); |
56 | MODULE_PARM_DESC(softraw, "Use software generated rawmode"); | 56 | MODULE_PARM_DESC(softraw, "Use software generated rawmode"); |
57 | 57 | ||
58 | static int atkbd_scroll; | 58 | static bool atkbd_scroll; |
59 | module_param_named(scroll, atkbd_scroll, bool, 0); | 59 | module_param_named(scroll, atkbd_scroll, bool, 0); |
60 | MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards"); | 60 | MODULE_PARM_DESC(scroll, "Enable scroll-wheel on MS Office and similar keyboards"); |
61 | 61 | ||
62 | static int atkbd_extra; | 62 | static bool atkbd_extra; |
63 | module_param_named(extra, atkbd_extra, bool, 0); | 63 | module_param_named(extra, atkbd_extra, bool, 0); |
64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); | 64 | MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and similar keyboards"); |
65 | 65 | ||
@@ -205,18 +205,18 @@ struct atkbd { | |||
205 | unsigned short keycode[ATKBD_KEYMAP_SIZE]; | 205 | unsigned short keycode[ATKBD_KEYMAP_SIZE]; |
206 | DECLARE_BITMAP(force_release_mask, ATKBD_KEYMAP_SIZE); | 206 | DECLARE_BITMAP(force_release_mask, ATKBD_KEYMAP_SIZE); |
207 | unsigned char set; | 207 | unsigned char set; |
208 | unsigned char translated; | 208 | bool translated; |
209 | unsigned char extra; | 209 | bool extra; |
210 | unsigned char write; | 210 | bool write; |
211 | unsigned char softrepeat; | 211 | bool softrepeat; |
212 | unsigned char softraw; | 212 | bool softraw; |
213 | unsigned char scroll; | 213 | bool scroll; |
214 | unsigned char enabled; | 214 | bool enabled; |
215 | 215 | ||
216 | /* Accessed only from interrupt */ | 216 | /* Accessed only from interrupt */ |
217 | unsigned char emul; | 217 | unsigned char emul; |
218 | unsigned char resend; | 218 | bool resend; |
219 | unsigned char release; | 219 | bool release; |
220 | unsigned long xl_bit; | 220 | unsigned long xl_bit; |
221 | unsigned int last; | 221 | unsigned int last; |
222 | unsigned long time; | 222 | unsigned long time; |
@@ -298,18 +298,18 @@ static const unsigned int xl_table[] = { | |||
298 | * Checks if we should mangle the scancode to extract 'release' bit | 298 | * Checks if we should mangle the scancode to extract 'release' bit |
299 | * in translated mode. | 299 | * in translated mode. |
300 | */ | 300 | */ |
301 | static int atkbd_need_xlate(unsigned long xl_bit, unsigned char code) | 301 | static bool atkbd_need_xlate(unsigned long xl_bit, unsigned char code) |
302 | { | 302 | { |
303 | int i; | 303 | int i; |
304 | 304 | ||
305 | if (code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1) | 305 | if (code == ATKBD_RET_EMUL0 || code == ATKBD_RET_EMUL1) |
306 | return 0; | 306 | return false; |
307 | 307 | ||
308 | for (i = 0; i < ARRAY_SIZE(xl_table); i++) | 308 | for (i = 0; i < ARRAY_SIZE(xl_table); i++) |
309 | if (code == xl_table[i]) | 309 | if (code == xl_table[i]) |
310 | return test_bit(i, &xl_bit); | 310 | return test_bit(i, &xl_bit); |
311 | 311 | ||
312 | return 1; | 312 | return true; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* | 315 | /* |
@@ -356,7 +356,7 @@ static unsigned int atkbd_compat_scancode(struct atkbd *atkbd, unsigned int code | |||
356 | */ | 356 | */ |
357 | 357 | ||
358 | static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | 358 | static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, |
359 | unsigned int flags) | 359 | unsigned int flags) |
360 | { | 360 | { |
361 | struct atkbd *atkbd = serio_get_drvdata(serio); | 361 | struct atkbd *atkbd = serio_get_drvdata(serio); |
362 | struct input_dev *dev = atkbd->dev; | 362 | struct input_dev *dev = atkbd->dev; |
@@ -365,20 +365,18 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | |||
365 | int value; | 365 | int value; |
366 | unsigned short keycode; | 366 | unsigned short keycode; |
367 | 367 | ||
368 | #ifdef ATKBD_DEBUG | 368 | dev_dbg(&serio->dev, "Received %02x flags %02x\n", data, flags); |
369 | printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); | ||
370 | #endif | ||
371 | 369 | ||
372 | #if !defined(__i386__) && !defined (__x86_64__) | 370 | #if !defined(__i386__) && !defined (__x86_64__) |
373 | if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && !atkbd->resend && atkbd->write) { | 371 | if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && !atkbd->resend && atkbd->write) { |
374 | printk(KERN_WARNING "atkbd.c: frame/parity error: %02x\n", flags); | 372 | dev_warn(&serio->dev, "Frame/parity error: %02x\n", flags); |
375 | serio_write(serio, ATKBD_CMD_RESEND); | 373 | serio_write(serio, ATKBD_CMD_RESEND); |
376 | atkbd->resend = 1; | 374 | atkbd->resend = true; |
377 | goto out; | 375 | goto out; |
378 | } | 376 | } |
379 | 377 | ||
380 | if (!flags && data == ATKBD_RET_ACK) | 378 | if (!flags && data == ATKBD_RET_ACK) |
381 | atkbd->resend = 0; | 379 | atkbd->resend = false; |
382 | #endif | 380 | #endif |
383 | 381 | ||
384 | if (unlikely(atkbd->ps2dev.flags & PS2_FLAG_ACK)) | 382 | if (unlikely(atkbd->ps2dev.flags & PS2_FLAG_ACK)) |
@@ -409,32 +407,32 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | |||
409 | } | 407 | } |
410 | 408 | ||
411 | switch (code) { | 409 | switch (code) { |
412 | case ATKBD_RET_BAT: | 410 | case ATKBD_RET_BAT: |
413 | atkbd->enabled = 0; | 411 | atkbd->enabled = false; |
414 | serio_reconnect(atkbd->ps2dev.serio); | 412 | serio_reconnect(atkbd->ps2dev.serio); |
415 | goto out; | 413 | goto out; |
416 | case ATKBD_RET_EMUL0: | 414 | case ATKBD_RET_EMUL0: |
417 | atkbd->emul = 1; | 415 | atkbd->emul = 1; |
418 | goto out; | 416 | goto out; |
419 | case ATKBD_RET_EMUL1: | 417 | case ATKBD_RET_EMUL1: |
420 | atkbd->emul = 2; | 418 | atkbd->emul = 2; |
421 | goto out; | 419 | goto out; |
422 | case ATKBD_RET_RELEASE: | 420 | case ATKBD_RET_RELEASE: |
423 | atkbd->release = 1; | 421 | atkbd->release = true; |
424 | goto out; | 422 | goto out; |
425 | case ATKBD_RET_ACK: | 423 | case ATKBD_RET_ACK: |
426 | case ATKBD_RET_NAK: | 424 | case ATKBD_RET_NAK: |
427 | if (printk_ratelimit()) | 425 | if (printk_ratelimit()) |
428 | printk(KERN_WARNING "atkbd.c: Spurious %s on %s. " | 426 | dev_warn(&serio->dev, |
429 | "Some program might be trying access hardware directly.\n", | 427 | "Spurious %s on %s. " |
430 | data == ATKBD_RET_ACK ? "ACK" : "NAK", serio->phys); | 428 | "Some program might be trying access hardware directly.\n", |
431 | goto out; | 429 | data == ATKBD_RET_ACK ? "ACK" : "NAK", serio->phys); |
432 | case ATKBD_RET_ERR: | 430 | goto out; |
433 | atkbd->err_count++; | 431 | case ATKBD_RET_ERR: |
434 | #ifdef ATKBD_DEBUG | 432 | atkbd->err_count++; |
435 | printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys); | 433 | dev_dbg(&serio->dev, "Keyboard on %s reports too many keys pressed.\n", |
436 | #endif | 434 | serio->phys); |
437 | goto out; | 435 | goto out; |
438 | } | 436 | } |
439 | 437 | ||
440 | code = atkbd_compat_scancode(atkbd, code); | 438 | code = atkbd_compat_scancode(atkbd, code); |
@@ -448,71 +446,72 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | |||
448 | input_event(dev, EV_MSC, MSC_SCAN, code); | 446 | input_event(dev, EV_MSC, MSC_SCAN, code); |
449 | 447 | ||
450 | switch (keycode) { | 448 | switch (keycode) { |
451 | case ATKBD_KEY_NULL: | 449 | case ATKBD_KEY_NULL: |
452 | break; | 450 | break; |
453 | case ATKBD_KEY_UNKNOWN: | 451 | case ATKBD_KEY_UNKNOWN: |
454 | printk(KERN_WARNING | 452 | dev_warn(&serio->dev, |
455 | "atkbd.c: Unknown key %s (%s set %d, code %#x on %s).\n", | 453 | "Unknown key %s (%s set %d, code %#x on %s).\n", |
456 | atkbd->release ? "released" : "pressed", | 454 | atkbd->release ? "released" : "pressed", |
457 | atkbd->translated ? "translated" : "raw", | 455 | atkbd->translated ? "translated" : "raw", |
458 | atkbd->set, code, serio->phys); | 456 | atkbd->set, code, serio->phys); |
459 | printk(KERN_WARNING | 457 | dev_warn(&serio->dev, |
460 | "atkbd.c: Use 'setkeycodes %s%02x <keycode>' to make it known.\n", | 458 | "Use 'setkeycodes %s%02x <keycode>' to make it known.\n", |
461 | code & 0x80 ? "e0" : "", code & 0x7f); | 459 | code & 0x80 ? "e0" : "", code & 0x7f); |
462 | input_sync(dev); | 460 | input_sync(dev); |
463 | break; | 461 | break; |
464 | case ATKBD_SCR_1: | 462 | case ATKBD_SCR_1: |
465 | scroll = 1 - atkbd->release * 2; | 463 | scroll = 1; |
466 | break; | 464 | break; |
467 | case ATKBD_SCR_2: | 465 | case ATKBD_SCR_2: |
468 | scroll = 2 - atkbd->release * 4; | 466 | scroll = 2; |
469 | break; | 467 | break; |
470 | case ATKBD_SCR_4: | 468 | case ATKBD_SCR_4: |
471 | scroll = 4 - atkbd->release * 8; | 469 | scroll = 4; |
472 | break; | 470 | break; |
473 | case ATKBD_SCR_8: | 471 | case ATKBD_SCR_8: |
474 | scroll = 8 - atkbd->release * 16; | 472 | scroll = 8; |
475 | break; | 473 | break; |
476 | case ATKBD_SCR_CLICK: | 474 | case ATKBD_SCR_CLICK: |
477 | click = !atkbd->release; | 475 | click = !atkbd->release; |
478 | break; | 476 | break; |
479 | case ATKBD_SCR_LEFT: | 477 | case ATKBD_SCR_LEFT: |
480 | hscroll = -1; | 478 | hscroll = -1; |
481 | break; | 479 | break; |
482 | case ATKBD_SCR_RIGHT: | 480 | case ATKBD_SCR_RIGHT: |
483 | hscroll = 1; | 481 | hscroll = 1; |
484 | break; | 482 | break; |
485 | default: | 483 | default: |
486 | if (atkbd->release) { | 484 | if (atkbd->release) { |
487 | value = 0; | 485 | value = 0; |
488 | atkbd->last = 0; | 486 | atkbd->last = 0; |
489 | } else if (!atkbd->softrepeat && test_bit(keycode, dev->key)) { | 487 | } else if (!atkbd->softrepeat && test_bit(keycode, dev->key)) { |
490 | /* Workaround Toshiba laptop multiple keypress */ | 488 | /* Workaround Toshiba laptop multiple keypress */ |
491 | value = time_before(jiffies, atkbd->time) && atkbd->last == code ? 1 : 2; | 489 | value = time_before(jiffies, atkbd->time) && atkbd->last == code ? 1 : 2; |
492 | } else { | 490 | } else { |
493 | value = 1; | 491 | value = 1; |
494 | atkbd->last = code; | 492 | atkbd->last = code; |
495 | atkbd->time = jiffies + msecs_to_jiffies(dev->rep[REP_DELAY]) / 2; | 493 | atkbd->time = jiffies + msecs_to_jiffies(dev->rep[REP_DELAY]) / 2; |
496 | } | 494 | } |
497 | 495 | ||
498 | input_event(dev, EV_KEY, keycode, value); | 496 | input_event(dev, EV_KEY, keycode, value); |
499 | input_sync(dev); | 497 | input_sync(dev); |
500 | 498 | ||
501 | if (value && test_bit(code, atkbd->force_release_mask)) { | 499 | if (value && test_bit(code, atkbd->force_release_mask)) { |
502 | input_report_key(dev, keycode, 0); | 500 | input_report_key(dev, keycode, 0); |
503 | input_sync(dev); | 501 | input_sync(dev); |
504 | } | 502 | } |
505 | } | 503 | } |
506 | 504 | ||
507 | if (atkbd->scroll) { | 505 | if (atkbd->scroll) { |
508 | if (click != -1) | 506 | if (click != -1) |
509 | input_report_key(dev, BTN_MIDDLE, click); | 507 | input_report_key(dev, BTN_MIDDLE, click); |
510 | input_report_rel(dev, REL_WHEEL, scroll); | 508 | input_report_rel(dev, REL_WHEEL, |
509 | atkbd->release ? -scroll : scroll); | ||
511 | input_report_rel(dev, REL_HWHEEL, hscroll); | 510 | input_report_rel(dev, REL_HWHEEL, hscroll); |
512 | input_sync(dev); | 511 | input_sync(dev); |
513 | } | 512 | } |
514 | 513 | ||
515 | atkbd->release = 0; | 514 | atkbd->release = false; |
516 | out: | 515 | out: |
517 | return IRQ_HANDLED; | 516 | return IRQ_HANDLED; |
518 | } | 517 | } |
@@ -631,17 +630,18 @@ static int atkbd_event(struct input_dev *dev, | |||
631 | 630 | ||
632 | switch (type) { | 631 | switch (type) { |
633 | 632 | ||
634 | case EV_LED: | 633 | case EV_LED: |
635 | atkbd_schedule_event_work(atkbd, ATKBD_LED_EVENT_BIT); | 634 | atkbd_schedule_event_work(atkbd, ATKBD_LED_EVENT_BIT); |
636 | return 0; | 635 | return 0; |
637 | 636 | ||
638 | case EV_REP: | 637 | case EV_REP: |
639 | if (!atkbd->softrepeat) | 638 | if (!atkbd->softrepeat) |
640 | atkbd_schedule_event_work(atkbd, ATKBD_REP_EVENT_BIT); | 639 | atkbd_schedule_event_work(atkbd, ATKBD_REP_EVENT_BIT); |
641 | return 0; | 640 | return 0; |
642 | } | ||
643 | 641 | ||
644 | return -1; | 642 | default: |
643 | return -1; | ||
644 | } | ||
645 | } | 645 | } |
646 | 646 | ||
647 | /* | 647 | /* |
@@ -652,7 +652,7 @@ static int atkbd_event(struct input_dev *dev, | |||
652 | static inline void atkbd_enable(struct atkbd *atkbd) | 652 | static inline void atkbd_enable(struct atkbd *atkbd) |
653 | { | 653 | { |
654 | serio_pause_rx(atkbd->ps2dev.serio); | 654 | serio_pause_rx(atkbd->ps2dev.serio); |
655 | atkbd->enabled = 1; | 655 | atkbd->enabled = true; |
656 | serio_continue_rx(atkbd->ps2dev.serio); | 656 | serio_continue_rx(atkbd->ps2dev.serio); |
657 | } | 657 | } |
658 | 658 | ||
@@ -664,7 +664,7 @@ static inline void atkbd_enable(struct atkbd *atkbd) | |||
664 | static inline void atkbd_disable(struct atkbd *atkbd) | 664 | static inline void atkbd_disable(struct atkbd *atkbd) |
665 | { | 665 | { |
666 | serio_pause_rx(atkbd->ps2dev.serio); | 666 | serio_pause_rx(atkbd->ps2dev.serio); |
667 | atkbd->enabled = 0; | 667 | atkbd->enabled = false; |
668 | serio_continue_rx(atkbd->ps2dev.serio); | 668 | serio_continue_rx(atkbd->ps2dev.serio); |
669 | } | 669 | } |
670 | 670 | ||
@@ -685,7 +685,9 @@ static int atkbd_probe(struct atkbd *atkbd) | |||
685 | 685 | ||
686 | if (atkbd_reset) | 686 | if (atkbd_reset) |
687 | if (ps2_command(ps2dev, NULL, ATKBD_CMD_RESET_BAT)) | 687 | if (ps2_command(ps2dev, NULL, ATKBD_CMD_RESET_BAT)) |
688 | printk(KERN_WARNING "atkbd.c: keyboard reset failed on %s\n", ps2dev->serio->phys); | 688 | dev_warn(&ps2dev->serio->dev, |
689 | "keyboard reset failed on %s\n", | ||
690 | ps2dev->serio->phys); | ||
689 | 691 | ||
690 | /* | 692 | /* |
691 | * Then we check the keyboard ID. We should get 0xab83 under normal conditions. | 693 | * Then we check the keyboard ID. We should get 0xab83 under normal conditions. |
@@ -715,8 +717,9 @@ static int atkbd_probe(struct atkbd *atkbd) | |||
715 | atkbd->id = (param[0] << 8) | param[1]; | 717 | atkbd->id = (param[0] << 8) | param[1]; |
716 | 718 | ||
717 | if (atkbd->id == 0xaca1 && atkbd->translated) { | 719 | if (atkbd->id == 0xaca1 && atkbd->translated) { |
718 | printk(KERN_ERR "atkbd.c: NCD terminal keyboards are only supported on non-translating\n"); | 720 | dev_err(&ps2dev->serio->dev, |
719 | printk(KERN_ERR "atkbd.c: controllers. Use i8042.direct=1 to disable translation.\n"); | 721 | "NCD terminal keyboards are only supported on non-translating controlelrs. " |
722 | "Use i8042.direct=1 to disable translation.\n"); | ||
720 | return -1; | 723 | return -1; |
721 | } | 724 | } |
722 | 725 | ||
@@ -734,7 +737,7 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
734 | struct ps2dev *ps2dev = &atkbd->ps2dev; | 737 | struct ps2dev *ps2dev = &atkbd->ps2dev; |
735 | unsigned char param[2]; | 738 | unsigned char param[2]; |
736 | 739 | ||
737 | atkbd->extra = 0; | 740 | atkbd->extra = false; |
738 | /* | 741 | /* |
739 | * For known special keyboards we can go ahead and set the correct set. | 742 | * For known special keyboards we can go ahead and set the correct set. |
740 | * We check for NCD PS/2 Sun, NorthGate OmniKey 101 and | 743 | * We check for NCD PS/2 Sun, NorthGate OmniKey 101 and |
@@ -753,7 +756,7 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra | |||
753 | if (allow_extra) { | 756 | if (allow_extra) { |
754 | param[0] = 0x71; | 757 | param[0] = 0x71; |
755 | if (!ps2_command(ps2dev, param, ATKBD_CMD_EX_ENABLE)) { | 758 | if (!ps2_command(ps2dev, param, ATKBD_CMD_EX_ENABLE)) { |
756 | atkbd->extra = 1; | 759 | atkbd->extra = true; |
757 | return 2; | 760 | return 2; |
758 | } | 761 | } |
759 | } | 762 | } |
@@ -818,7 +821,8 @@ static int atkbd_activate(struct atkbd *atkbd) | |||
818 | */ | 821 | */ |
819 | 822 | ||
820 | if (ps2_command(ps2dev, NULL, ATKBD_CMD_ENABLE)) { | 823 | if (ps2_command(ps2dev, NULL, ATKBD_CMD_ENABLE)) { |
821 | printk(KERN_ERR "atkbd.c: Failed to enable keyboard on %s\n", | 824 | dev_err(&ps2dev->serio->dev, |
825 | "Failed to enable keyboard on %s\n", | ||
822 | ps2dev->serio->phys); | 826 | ps2dev->serio->phys); |
823 | return -1; | 827 | return -1; |
824 | } | 828 | } |
@@ -1090,12 +1094,14 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
1090 | 1094 | ||
1091 | switch (serio->id.type) { | 1095 | switch (serio->id.type) { |
1092 | 1096 | ||
1093 | case SERIO_8042_XL: | 1097 | case SERIO_8042_XL: |
1094 | atkbd->translated = 1; | 1098 | atkbd->translated = true; |
1095 | case SERIO_8042: | 1099 | /* Fall through */ |
1096 | if (serio->write) | 1100 | |
1097 | atkbd->write = 1; | 1101 | case SERIO_8042: |
1098 | break; | 1102 | if (serio->write) |
1103 | atkbd->write = true; | ||
1104 | break; | ||
1099 | } | 1105 | } |
1100 | 1106 | ||
1101 | atkbd->softraw = atkbd_softraw; | 1107 | atkbd->softraw = atkbd_softraw; |
@@ -1103,7 +1109,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) | |||
1103 | atkbd->scroll = atkbd_scroll; | 1109 | atkbd->scroll = atkbd_scroll; |
1104 | 1110 | ||
1105 | if (atkbd->softrepeat) | 1111 | if (atkbd->softrepeat) |
1106 | atkbd->softraw = 1; | 1112 | atkbd->softraw = true; |
1107 | 1113 | ||
1108 | serio_set_drvdata(serio, atkbd); | 1114 | serio_set_drvdata(serio, atkbd); |
1109 | 1115 | ||
@@ -1161,7 +1167,8 @@ static int atkbd_reconnect(struct serio *serio) | |||
1161 | struct serio_driver *drv = serio->drv; | 1167 | struct serio_driver *drv = serio->drv; |
1162 | 1168 | ||
1163 | if (!atkbd || !drv) { | 1169 | if (!atkbd || !drv) { |
1164 | printk(KERN_DEBUG "atkbd: reconnect request, but serio is disconnected, ignoring...\n"); | 1170 | dev_dbg(&serio->dev, |
1171 | "reconnect request, but serio is disconnected, ignoring...\n"); | ||
1165 | return -1; | 1172 | return -1; |
1166 | } | 1173 | } |
1167 | 1174 | ||
@@ -1288,7 +1295,8 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun | |||
1288 | struct input_dev *old_dev, *new_dev; | 1295 | struct input_dev *old_dev, *new_dev; |
1289 | unsigned long value; | 1296 | unsigned long value; |
1290 | int err; | 1297 | int err; |
1291 | unsigned char old_extra, old_set; | 1298 | bool old_extra; |
1299 | unsigned char old_set; | ||
1292 | 1300 | ||
1293 | if (!atkbd->write) | 1301 | if (!atkbd->write) |
1294 | return -EIO; | 1302 | return -EIO; |
@@ -1371,7 +1379,7 @@ static ssize_t atkbd_set_scroll(struct atkbd *atkbd, const char *buf, size_t cou | |||
1371 | struct input_dev *old_dev, *new_dev; | 1379 | struct input_dev *old_dev, *new_dev; |
1372 | unsigned long value; | 1380 | unsigned long value; |
1373 | int err; | 1381 | int err; |
1374 | unsigned char old_scroll; | 1382 | bool old_scroll; |
1375 | 1383 | ||
1376 | if (strict_strtoul(buf, 10, &value) || value > 1) | 1384 | if (strict_strtoul(buf, 10, &value) || value > 1) |
1377 | return -EINVAL; | 1385 | return -EINVAL; |
@@ -1415,7 +1423,8 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t count) | |||
1415 | struct input_dev *old_dev, *new_dev; | 1423 | struct input_dev *old_dev, *new_dev; |
1416 | unsigned long value; | 1424 | unsigned long value; |
1417 | int err; | 1425 | int err; |
1418 | unsigned char old_set, old_extra; | 1426 | unsigned char old_set; |
1427 | bool old_extra; | ||
1419 | 1428 | ||
1420 | if (!atkbd->write) | 1429 | if (!atkbd->write) |
1421 | return -EIO; | 1430 | return -EIO; |
@@ -1465,7 +1474,7 @@ static ssize_t atkbd_set_softrepeat(struct atkbd *atkbd, const char *buf, size_t | |||
1465 | struct input_dev *old_dev, *new_dev; | 1474 | struct input_dev *old_dev, *new_dev; |
1466 | unsigned long value; | 1475 | unsigned long value; |
1467 | int err; | 1476 | int err; |
1468 | unsigned char old_softrepeat, old_softraw; | 1477 | bool old_softrepeat, old_softraw; |
1469 | 1478 | ||
1470 | if (!atkbd->write) | 1479 | if (!atkbd->write) |
1471 | return -EIO; | 1480 | return -EIO; |
@@ -1485,7 +1494,7 @@ static ssize_t atkbd_set_softrepeat(struct atkbd *atkbd, const char *buf, size_t | |||
1485 | atkbd->dev = new_dev; | 1494 | atkbd->dev = new_dev; |
1486 | atkbd->softrepeat = value; | 1495 | atkbd->softrepeat = value; |
1487 | if (atkbd->softrepeat) | 1496 | if (atkbd->softrepeat) |
1488 | atkbd->softraw = 1; | 1497 | atkbd->softraw = true; |
1489 | atkbd_set_device_attrs(atkbd); | 1498 | atkbd_set_device_attrs(atkbd); |
1490 | 1499 | ||
1491 | err = input_register_device(atkbd->dev); | 1500 | err = input_register_device(atkbd->dev); |
@@ -1515,7 +1524,7 @@ static ssize_t atkbd_set_softraw(struct atkbd *atkbd, const char *buf, size_t co | |||
1515 | struct input_dev *old_dev, *new_dev; | 1524 | struct input_dev *old_dev, *new_dev; |
1516 | unsigned long value; | 1525 | unsigned long value; |
1517 | int err; | 1526 | int err; |
1518 | unsigned char old_softraw; | 1527 | bool old_softraw; |
1519 | 1528 | ||
1520 | if (strict_strtoul(buf, 10, &value) || value > 1) | 1529 | if (strict_strtoul(buf, 10, &value) || value > 1) |
1521 | return -EINVAL; | 1530 | return -EINVAL; |