aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-19 05:28:36 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-19 05:32:10 -0500
commit2b1b78114319e0ed2b7ca8c75d9cde6d2bf8f9fc (patch)
tree293e02e85be238280dae1ca0cfd08e5d5e09a233 /sound/drivers
parentb093ed23dad894d473bb2e9948facf7fc509ae77 (diff)
ALSA: mtpav: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
-rw-r--r--sound/drivers/mtpav.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index 15769447688f..30e8a1d5bc87 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -414,8 +414,7 @@ static void snd_mtpav_output_timer(unsigned long data)
414 414
415 spin_lock_irqsave(&chip->spinlock, flags); 415 spin_lock_irqsave(&chip->spinlock, flags);
416 /* reprogram timer */ 416 /* reprogram timer */
417 chip->timer.expires = 1 + jiffies; 417 mod_timer(&chip->timer, 1 + jiffies);
418 add_timer(&chip->timer);
419 /* process each port */ 418 /* process each port */
420 for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) { 419 for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) {
421 struct mtpav_port *portp = &chip->ports[p]; 420 struct mtpav_port *portp = &chip->ports[p];
@@ -428,8 +427,7 @@ static void snd_mtpav_output_timer(unsigned long data)
428/* spinlock held! */ 427/* spinlock held! */
429static void snd_mtpav_add_output_timer(struct mtpav *chip) 428static void snd_mtpav_add_output_timer(struct mtpav *chip)
430{ 429{
431 chip->timer.expires = 1 + jiffies; 430 mod_timer(&chip->timer, 1 + jiffies);
432 add_timer(&chip->timer);
433} 431}
434 432
435/* spinlock held! */ 433/* spinlock held! */
@@ -704,15 +702,13 @@ static int snd_mtpav_probe(struct platform_device *dev)
704 702
705 mtp_card = card->private_data; 703 mtp_card = card->private_data;
706 spin_lock_init(&mtp_card->spinlock); 704 spin_lock_init(&mtp_card->spinlock);
707 init_timer(&mtp_card->timer);
708 mtp_card->card = card; 705 mtp_card->card = card;
709 mtp_card->irq = -1; 706 mtp_card->irq = -1;
710 mtp_card->share_irq = 0; 707 mtp_card->share_irq = 0;
711 mtp_card->inmidistate = 0; 708 mtp_card->inmidistate = 0;
712 mtp_card->outmidihwport = 0xffffffff; 709 mtp_card->outmidihwport = 0xffffffff;
713 init_timer(&mtp_card->timer); 710 setup_timer(&mtp_card->timer, snd_mtpav_output_timer,
714 mtp_card->timer.function = snd_mtpav_output_timer; 711 (unsigned long) mtp_card);
715 mtp_card->timer.data = (unsigned long) mtp_card;
716 712
717 card->private_free = snd_mtpav_free; 713 card->private_free = snd_mtpav_free;
718 714