diff options
Diffstat (limited to 'drivers/input/misc/ati_remote2.c')
-rw-r--r-- | drivers/input/misc/ati_remote2.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 0501f0e65157..2124b99378bb 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/usb/input.h> | 12 | #include <linux/usb/input.h> |
13 | #include <linux/slab.h> | ||
13 | 14 | ||
14 | #define DRIVER_DESC "ATI/Philips USB RF remote driver" | 15 | #define DRIVER_DESC "ATI/Philips USB RF remote driver" |
15 | #define DRIVER_VERSION "0.3" | 16 | #define DRIVER_VERSION "0.3" |
@@ -474,10 +475,11 @@ static void ati_remote2_complete_key(struct urb *urb) | |||
474 | } | 475 | } |
475 | 476 | ||
476 | static int ati_remote2_getkeycode(struct input_dev *idev, | 477 | static int ati_remote2_getkeycode(struct input_dev *idev, |
477 | int scancode, int *keycode) | 478 | unsigned int scancode, unsigned int *keycode) |
478 | { | 479 | { |
479 | struct ati_remote2 *ar2 = input_get_drvdata(idev); | 480 | struct ati_remote2 *ar2 = input_get_drvdata(idev); |
480 | int index, mode; | 481 | unsigned int mode; |
482 | int index; | ||
481 | 483 | ||
482 | mode = scancode >> 8; | 484 | mode = scancode >> 8; |
483 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) | 485 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) |
@@ -491,10 +493,12 @@ static int ati_remote2_getkeycode(struct input_dev *idev, | |||
491 | return 0; | 493 | return 0; |
492 | } | 494 | } |
493 | 495 | ||
494 | static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keycode) | 496 | static int ati_remote2_setkeycode(struct input_dev *idev, |
497 | unsigned int scancode, unsigned int keycode) | ||
495 | { | 498 | { |
496 | struct ati_remote2 *ar2 = input_get_drvdata(idev); | 499 | struct ati_remote2 *ar2 = input_get_drvdata(idev); |
497 | int index, mode, old_keycode; | 500 | unsigned int mode, old_keycode; |
501 | int index; | ||
498 | 502 | ||
499 | mode = scancode >> 8; | 503 | mode = scancode >> 8; |
500 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) | 504 | if (mode > ATI_REMOTE2_PC || !((1 << mode) & ar2->mode_mask)) |
@@ -504,9 +508,6 @@ static int ati_remote2_setkeycode(struct input_dev *idev, int scancode, int keyc | |||
504 | if (index < 0) | 508 | if (index < 0) |
505 | return -EINVAL; | 509 | return -EINVAL; |
506 | 510 | ||
507 | if (keycode < KEY_RESERVED || keycode > KEY_MAX) | ||
508 | return -EINVAL; | ||
509 | |||
510 | old_keycode = ar2->keycode[mode][index]; | 511 | old_keycode = ar2->keycode[mode][index]; |
511 | ar2->keycode[mode][index] = keycode; | 512 | ar2->keycode[mode][index] = keycode; |
512 | __set_bit(keycode, idev->keybit); | 513 | __set_bit(keycode, idev->keybit); |