aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-12-02 13:56:47 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:42:22 -0500
commit7fee03e487e87a196deb5602ee3c7676511995c9 (patch)
treeb46cfcd2d0cbe8640125cbd6548355872e36c193 /include/media
parenta53e21257171af42c9fa6aee417f7891744d6ebf (diff)
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>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/ir-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 452f6e86084d..e41a99ee353e 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -26,6 +26,7 @@
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/spinlock.h>
29 30
30extern int media_ir_debug; /* media_ir_debug level (0,1,2) */ 31extern int media_ir_debug; /* media_ir_debug level (0,1,2) */
31#define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \ 32#define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \
@@ -43,6 +44,7 @@ struct ir_scancode {
43struct ir_scancode_table { 44struct ir_scancode_table {
44 struct ir_scancode *scan; 45 struct ir_scancode *scan;
45 int size; 46 int size;
47 spinlock_t lock;
46}; 48};
47 49
48#define RC5_START(x) (((x)>>12)&3) 50#define RC5_START(x) (((x)>>12)&3)