summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2010-11-19 20:42:57 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 08:16:54 -0200
commit7c8352d18ddbe37cff8ad71175a11739662ef899 (patch)
treecf55e462816bb638fd3f665bf5c68a54964347c3
parent651c7a5f7f2f7277f8fc4fb38e89c79845ec9bf9 (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>
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c10
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
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)
if (ir->polling) {
setup_timer(&ir->timer, saa7134_input_timer,
(unsigned long)dev);
- ir->timer.expires = jiffies + HZ;
+ ir->timer.expires = jiffies + HZ;
add_timer(&ir->timer);
} else if (ir->raw_decode) {
/* set timer_end for code completion */
- setup_timer(&ir->timer_end, ir_raw_decode_timer_end,
+ setup_timer(&ir->timer, ir_raw_decode_timer_end,
(unsigned long)dev);
}
@@ -443,10 +443,8 @@ static void __saa7134_ir_stop(void *priv)
if (!ir->running)
return;
- if (ir->polling)
+ if (ir->polling || ir->raw_decode)
del_timer_sync(&ir->timer);
- else if (ir->raw_decode)
- del_timer_sync(&ir->timer_end);
ir->active = false;
ir->running = false;
@@ -923,7 +921,7 @@ static int saa7134_raw_decode_irq(struct saa7134_dev *dev)
*/
if (!ir->active) {
timeout = jiffies + jiffies_to_msecs(15);
- mod_timer(&ir->timer_end, timeout);
+ mod_timer(&ir->timer, timeout);
ir->active = true;
}
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 {
bool active;
struct timer_list timer;
- struct timer_list timer_end; /* timer_end for code completion */
/* IR core raw decoding */
u32 raw_decode;