From 7fee03e487e87a196deb5602ee3c7676511995c9 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 2 Dec 2009 15:56:47 -0300 Subject: 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 --- include/media/ir-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 452f6e8..e41a99e 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h @@ -26,6 +26,7 @@ #include #include #include +#include extern int media_ir_debug; /* media_ir_debug level (0,1,2) */ #define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \ @@ -43,6 +44,7 @@ struct ir_scancode { struct ir_scancode_table { struct ir_scancode *scan; int size; + spinlock_t lock; }; #define RC5_START(x) (((x)>>12)&3) -- cgit v1.1