aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/winbond-cir.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/winbond-cir.c')
-rw-r--r--drivers/input/misc/winbond-cir.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/input/misc/winbond-cir.c b/drivers/input/misc/winbond-cir.c
index cbec3dfdd42b..9c155a43abc2 100644
--- a/drivers/input/misc/winbond-cir.c
+++ b/drivers/input/misc/winbond-cir.c
@@ -385,26 +385,24 @@ wbcir_do_getkeycode(struct wbcir_data *data, u32 scancode)
385} 385}
386 386
387static int 387static int
388wbcir_getkeycode(struct input_dev *dev, int scancode, int *keycode) 388wbcir_getkeycode(struct input_dev *dev,
389 unsigned int scancode, unsigned int *keycode)
389{ 390{
390 struct wbcir_data *data = input_get_drvdata(dev); 391 struct wbcir_data *data = input_get_drvdata(dev);
391 392
392 *keycode = (int)wbcir_do_getkeycode(data, (u32)scancode); 393 *keycode = wbcir_do_getkeycode(data, scancode);
393 return 0; 394 return 0;
394} 395}
395 396
396static int 397static int
397wbcir_setkeycode(struct input_dev *dev, int sscancode, int keycode) 398wbcir_setkeycode(struct input_dev *dev,
399 unsigned int scancode, unsigned int keycode)
398{ 400{
399 struct wbcir_data *data = input_get_drvdata(dev); 401 struct wbcir_data *data = input_get_drvdata(dev);
400 struct wbcir_keyentry *keyentry; 402 struct wbcir_keyentry *keyentry;
401 struct wbcir_keyentry *new_keyentry; 403 struct wbcir_keyentry *new_keyentry;
402 unsigned long flags; 404 unsigned long flags;
403 unsigned int old_keycode = KEY_RESERVED; 405 unsigned int old_keycode = KEY_RESERVED;
404 u32 scancode = (u32)sscancode;
405
406 if (keycode < 0 || keycode > KEY_MAX)
407 return -EINVAL;
408 406
409 new_keyentry = kmalloc(sizeof(*new_keyentry), GFP_KERNEL); 407 new_keyentry = kmalloc(sizeof(*new_keyentry), GFP_KERNEL);
410 if (!new_keyentry) 408 if (!new_keyentry)