diff options
author | David Härdeman <david@hardeman.nu> | 2010-11-19 18:42:57 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:54 -0500 |
commit | 7c8352d18ddbe37cff8ad71175a11739662ef899 (patch) | |
tree | cf55e462816bb638fd3f665bf5c68a54964347c3 /drivers/media/video/saa7134 | |
parent | 651c7a5f7f2f7277f8fc4fb38e89c79845ec9bf9 (diff) |
[media] saa7134: merge saa7134_card_ir->timer and saa7134_card_ir->timer_end
Both timers are used for a similar purpose. Merging them allows for some
minor simplifications.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 10 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 1 |
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index d75c307981bc..98678d941847 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -420,11 +420,11 @@ static int __saa7134_ir_start(void *priv) | |||
420 | if (ir->polling) { | 420 | if (ir->polling) { |
421 | setup_timer(&ir->timer, saa7134_input_timer, | 421 | setup_timer(&ir->timer, saa7134_input_timer, |
422 | (unsigned long)dev); | 422 | (unsigned long)dev); |
423 | ir->timer.expires = jiffies + HZ; | 423 | ir->timer.expires = jiffies + HZ; |
424 | add_timer(&ir->timer); | 424 | add_timer(&ir->timer); |
425 | } else if (ir->raw_decode) { | 425 | } else if (ir->raw_decode) { |
426 | /* set timer_end for code completion */ | 426 | /* set timer_end for code completion */ |
427 | setup_timer(&ir->timer_end, ir_raw_decode_timer_end, | 427 | setup_timer(&ir->timer, ir_raw_decode_timer_end, |
428 | (unsigned long)dev); | 428 | (unsigned long)dev); |
429 | } | 429 | } |
430 | 430 | ||
@@ -443,10 +443,8 @@ static void __saa7134_ir_stop(void *priv) | |||
443 | if (!ir->running) | 443 | if (!ir->running) |
444 | return; | 444 | return; |
445 | 445 | ||
446 | if (ir->polling) | 446 | if (ir->polling || ir->raw_decode) |
447 | del_timer_sync(&ir->timer); | 447 | del_timer_sync(&ir->timer); |
448 | else if (ir->raw_decode) | ||
449 | del_timer_sync(&ir->timer_end); | ||
450 | 448 | ||
451 | ir->active = false; | 449 | ir->active = false; |
452 | ir->running = false; | 450 | ir->running = false; |
@@ -923,7 +921,7 @@ static int saa7134_raw_decode_irq(struct saa7134_dev *dev) | |||
923 | */ | 921 | */ |
924 | if (!ir->active) { | 922 | if (!ir->active) { |
925 | timeout = jiffies + jiffies_to_msecs(15); | 923 | timeout = jiffies + jiffies_to_msecs(15); |
926 | mod_timer(&ir->timer_end, timeout); | 924 | mod_timer(&ir->timer, timeout); |
927 | ir->active = true; | 925 | ir->active = true; |
928 | } | 926 | } |
929 | 927 | ||
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index f93951acec41..babfbe7543eb 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -134,7 +134,6 @@ struct saa7134_card_ir { | |||
134 | bool active; | 134 | bool active; |
135 | 135 | ||
136 | struct timer_list timer; | 136 | struct timer_list timer; |
137 | struct timer_list timer_end; /* timer_end for code completion */ | ||
138 | 137 | ||
139 | /* IR core raw decoding */ | 138 | /* IR core raw decoding */ |
140 | u32 raw_decode; | 139 | u32 raw_decode; |