Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68660
b: refs/heads/master
c: 77b2966
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Kosina committed Oct 14, 2007
1 parent 485d2ed commit f77a85a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b27c9590ca0f44681fe2504a7ec427ff1bb77e82
refs/heads/master: 77b296629d6e938e68de40195a9d500f209f6d10
12 changes: 6 additions & 6 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode,
{
struct hid_device *hid = dev->private;
struct hid_usage *usage;

usage = hidinput_find_key(hid, scancode, 0);
if (usage) {
*keycode = usage->code;
Expand All @@ -314,26 +314,26 @@ static int hidinput_setkeycode(struct input_dev *dev, int scancode,
struct hid_device *hid = dev->private;
struct hid_usage *usage;
int old_keycode;

if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;

usage = hidinput_find_key(hid, scancode, 0);
if (usage) {
old_keycode = usage->code;
usage->code = keycode;

clear_bit(old_keycode, dev->keybit);
set_bit(usage->code, dev->keybit);
dbg_hid(KERN_DEBUG "Assigned keycode %d to HID usage code %x\n", keycode, scancode);
/* Set the keybit for the old keycode if the old keycode is used
* by another key */
if (hidinput_find_key (hid, 0, old_keycode))
set_bit(old_keycode, dev->keybit);

return 0;
}

return -EINVAL;
}

Expand Down

0 comments on commit f77a85a

Please sign in to comment.