aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/hp-wmi.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-09 01:37:10 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-03-09 02:19:15 -0500
commit58b939959d228681208ba997595411fddc860849 (patch)
tree3bfa2df2c811e14698e066f093a6dd7d75f45672 /drivers/platform/x86/hp-wmi.c
parentec62e1c8dd2f9b2a833b48d4a2f58f0c5e07384c (diff)
Input: scancode in get/set_keycodes should be unsigned
The HID layer has some scan codes of the form 0xffbc0000 for logitech devices which do not work if scancode is typed as signed int, so we need to switch to unsigned it instead. While at it keycode being signed does not make much sense either. Acked-by: Márton Németh <nm127@freemail.hu> Acked-by: Matthew Garrett <mjg@redhat.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/platform/x86/hp-wmi.c')
-rw-r--r--drivers/platform/x86/hp-wmi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 7ccf33c08967..56086363becc 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -278,7 +278,7 @@ static DEVICE_ATTR(als, S_IRUGO | S_IWUSR, show_als, set_als);
278static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL); 278static DEVICE_ATTR(dock, S_IRUGO, show_dock, NULL);
279static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL); 279static DEVICE_ATTR(tablet, S_IRUGO, show_tablet, NULL);
280 280
281static struct key_entry *hp_wmi_get_entry_by_scancode(int code) 281static struct key_entry *hp_wmi_get_entry_by_scancode(unsigned int code)
282{ 282{
283 struct key_entry *key; 283 struct key_entry *key;
284 284
@@ -289,7 +289,7 @@ static struct key_entry *hp_wmi_get_entry_by_scancode(int code)
289 return NULL; 289 return NULL;
290} 290}
291 291
292static struct key_entry *hp_wmi_get_entry_by_keycode(int keycode) 292static struct key_entry *hp_wmi_get_entry_by_keycode(unsigned int keycode)
293{ 293{
294 struct key_entry *key; 294 struct key_entry *key;
295 295
@@ -300,7 +300,8 @@ static struct key_entry *hp_wmi_get_entry_by_keycode(int keycode)
300 return NULL; 300 return NULL;
301} 301}
302 302
303static int hp_wmi_getkeycode(struct input_dev *dev, int scancode, int *keycode) 303static int hp_wmi_getkeycode(struct input_dev *dev,
304 unsigned int scancode, unsigned int *keycode)
304{ 305{
305 struct key_entry *key = hp_wmi_get_entry_by_scancode(scancode); 306 struct key_entry *key = hp_wmi_get_entry_by_scancode(scancode);
306 307
@@ -312,13 +313,11 @@ static int hp_wmi_getkeycode(struct input_dev *dev, int scancode, int *keycode)
312 return -EINVAL; 313 return -EINVAL;
313} 314}
314 315
315static int hp_wmi_setkeycode(struct input_dev *dev, int scancode, int keycode) 316static int hp_wmi_setkeycode(struct input_dev *dev,
317 unsigned int scancode, unsigned int keycode)
316{ 318{
317 struct key_entry *key; 319 struct key_entry *key;
318 int old_keycode; 320 unsigned int old_keycode;
319
320 if (keycode < 0 || keycode > KEY_MAX)
321 return -EINVAL;
322 321
323 key = hp_wmi_get_entry_by_scancode(scancode); 322 key = hp_wmi_get_entry_by_scancode(scancode);
324 if (key && key->type == KE_KEY) { 323 if (key && key->type == KE_KEY) {