diff options
| author | 2011-02-16 09:36:05 +0000 | |
|---|---|---|
| committer | 2011-02-16 09:44:30 +0000 | |
| commit | 9035a97a32836d0e456ddafaaf249a844e6e4b5e (patch) | |
| tree | 41ec3db083bdb46cd831f0d39db1fe294ae7d55f /drivers/media/rc/rc-main.c | |
| parent | drm/i915: Move the lvds OpRegion lid detection code to panel and reuse for eDP (diff) | |
| parent | agp/intel: Experiment with a 855GM GWB bit (diff) | |
| download | linux-dev-9035a97a32836d0e456ddafaaf249a844e6e4b5e.tar.xz linux-dev-9035a97a32836d0e456ddafaaf249a844e6e4b5e.zip | |
Merge branch 'drm-intel-fixes' into drm-intel-next
Grab the latest stabilisation bits from -fixes and some suspend and
resume fixes from linus.
Conflicts:
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c
Diffstat (limited to 'drivers/media/rc/rc-main.c')
| -rw-r--r-- | drivers/media/rc/rc-main.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 72be8a02118c..512a2f4ada0e 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -458,21 +458,27 @@ static int ir_getkeycode(struct input_dev *idev, index = ir_lookup_by_scancode(rc_map, scancode); } - if (index >= rc_map->len) { - if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) - IR_dprintk(1, "unknown key for scancode 0x%04x\n", - scancode); + if (index < rc_map->len) { + entry = &rc_map->scan[index]; + + ke->index = index; + ke->keycode = entry->keycode; + ke->len = sizeof(entry->scancode); + memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); + + } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { + /* + * We do not really know the valid range of scancodes + * so let's respond with KEY_RESERVED to anything we + * do not have mapping for [yet]. + */ + ke->index = index; + ke->keycode = KEY_RESERVED; + } else { retval = -EINVAL; goto out; } - entry = &rc_map->scan[index]; - - ke->index = index; - ke->keycode = entry->keycode; - ke->len = sizeof(entry->scancode); - memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); - retval = 0; out: |
