]> bbs.cooldavid.org Git - net-next-2.6.git/commit - drivers/media/IR/ir-keytable.c
V4L/DVB (13540): ir-common: Cleanup get key evdev code
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 2 Dec 2009 18:56:47 +0000 (15:56 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:42:22 +0000 (18:42 -0200)
commit7fee03e487e87a196deb5602ee3c7676511995c9
treeb46cfcd2d0cbe8640125cbd6548355872e36c193
parenta53e21257171af42c9fa6aee417f7891744d6ebf
V4L/DVB (13540): ir-common: Cleanup get key evdev code

The same loop to seek for a key were used on different places. Also,
no spinlock were protecting it to avoid the risk of replacing a keycode
while seeking for a new code.

This cleanup does:
- create an unique function to seek for a code;
- adds an spinlock to protect the table lookup;
- remove some unused code;
- simplifies to code to make it easier to understand.

Basically no change in behavior should be noticed after this patch.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/ir-keytable.c
include/media/ir-common.h