aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-07 15:19:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:01 -0400
commit6eb9435b874ae5ff56d56952167a8e9be5c5deeb (patch)
treea31bd6732a7396d7350baf5e5019b4037737609b /drivers/media/IR
parentc373cabfbbb7631526003f17d470c0d1e5915a4c (diff)
V4L/DVB: ir: Make sure that the spinlocks are properly initialized
Some spinlocks are not properly initialized on ir core: [ 471.714132] BUG: spinlock bad magic on CPU#0, modprobe/1899 [ 471.719838] lock: f92a08ac, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0 [ 471.727301] Pid: 1899, comm: modprobe Not tainted 2.6.33 #36 [ 471.733062] Call Trace: [ 471.735537] [<c1498793>] ? printk+0x1d/0x22 [ 471.739866] [<c12694e3>] spin_bug+0xa3/0xf0 [ 471.744224] [<c126962d>] do_raw_spin_lock+0x7d/0x160 [ 471.749364] [<f92a01ff>] ? ir_rc5_register+0x6f/0xf0 [ir_rc5_decoder] So, use static initialization for the static spinlocks, instead of the dynamic ones (currently used), as proposed by David Härdeman on one of his RFC patches. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r--drivers/media/IR/ir-nec-decoder.c2
-rw-r--r--drivers/media/IR/ir-raw-event.c4
-rw-r--r--drivers/media/IR/ir-rc5-decoder.c2
-rw-r--r--drivers/media/IR/rc-map.c3
4 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c
index 9d1ada95aa72..18918e52c0c0 100644
--- a/drivers/media/IR/ir-nec-decoder.c
+++ b/drivers/media/IR/ir-nec-decoder.c
@@ -25,7 +25,7 @@
25 25
26/* Used to register nec_decoder clients */ 26/* Used to register nec_decoder clients */
27static LIST_HEAD(decoder_list); 27static LIST_HEAD(decoder_list);
28static spinlock_t decoder_lock; 28static DEFINE_SPINLOCK(decoder_lock);
29 29
30enum nec_state { 30enum nec_state {
31 STATE_INACTIVE, 31 STATE_INACTIVE,
diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c
index 57990a337922..ddb3365adc82 100644
--- a/drivers/media/IR/ir-raw-event.c
+++ b/drivers/media/IR/ir-raw-event.c
@@ -21,7 +21,7 @@
21 21
22/* Used to handle IR raw handler extensions */ 22/* Used to handle IR raw handler extensions */
23static LIST_HEAD(ir_raw_handler_list); 23static LIST_HEAD(ir_raw_handler_list);
24static spinlock_t ir_raw_handler_lock; 24static DEFINE_SPINLOCK(ir_raw_handler_lock);
25 25
26/** 26/**
27 * RUN_DECODER() - runs an operation on all IR decoders 27 * RUN_DECODER() - runs an operation on all IR decoders
@@ -205,8 +205,6 @@ static void init_decoders(struct work_struct *work)
205 205
206void ir_raw_init(void) 206void ir_raw_init(void)
207{ 207{
208 spin_lock_init(&ir_raw_handler_lock);
209
210#ifdef MODULE 208#ifdef MODULE
211 INIT_WORK(&wq_load, init_decoders); 209 INIT_WORK(&wq_load, init_decoders);
212 schedule_work(&wq_load); 210 schedule_work(&wq_load);
diff --git a/drivers/media/IR/ir-rc5-decoder.c b/drivers/media/IR/ir-rc5-decoder.c
index a62277b625a8..6323066438b5 100644
--- a/drivers/media/IR/ir-rc5-decoder.c
+++ b/drivers/media/IR/ir-rc5-decoder.c
@@ -29,7 +29,7 @@ static unsigned int ir_rc5_remote_gap = 888888;
29 29
30/* Used to register rc5_decoder clients */ 30/* Used to register rc5_decoder clients */
31static LIST_HEAD(decoder_list); 31static LIST_HEAD(decoder_list);
32static spinlock_t decoder_lock; 32static DEFINE_SPINLOCK(decoder_lock);
33 33
34enum rc5_state { 34enum rc5_state {
35 STATE_INACTIVE, 35 STATE_INACTIVE,
diff --git a/drivers/media/IR/rc-map.c b/drivers/media/IR/rc-map.c
index 2f6201ce1898..ff185c054267 100644
--- a/drivers/media/IR/rc-map.c
+++ b/drivers/media/IR/rc-map.c
@@ -17,8 +17,7 @@
17 17
18/* Used to handle IR raw handler extensions */ 18/* Used to handle IR raw handler extensions */
19static LIST_HEAD(rc_map_list); 19static LIST_HEAD(rc_map_list);
20static spinlock_t rc_map_lock; 20static DEFINE_SPINLOCK(rc_map_lock);
21
22 21
23static struct rc_keymap *seek_rc_map(const char *name) 22static struct rc_keymap *seek_rc_map(const char *name)
24{ 23{