]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: asihpi: Use setup_timer() and mod_timer()
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:32:51 +0000 (11:32 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:32:51 +0000 (11:32 +0100)
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/asihpi/asihpi.c

index 7a55fefed5c4cfee51f2378e2e049f248ca3ba88..e5cd7be85355199d30c5c5db969afe58d9d38fbd 100644 (file)
@@ -540,9 +540,8 @@ static void snd_card_asihpi_pcm_timer_start(struct snd_pcm_substream *
        expiry = HZ / 200;
 
        expiry = max(expiry, 1); /* don't let it be zero! */
-       dpcm->timer.expires = jiffies + expiry;
+       mod_timer(&dpcm->timer, jiffies + expiry);
        dpcm->respawn_timer = 1;
-       add_timer(&dpcm->timer);
 }
 
 static void snd_card_asihpi_pcm_timer_stop(struct snd_pcm_substream *substream)
@@ -1064,9 +1063,8 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream)
            If internal and other stream playing, can't switch
        */
 
-       init_timer(&dpcm->timer);
-       dpcm->timer.data = (unsigned long) dpcm;
-       dpcm->timer.function = snd_card_asihpi_timer_function;
+       setup_timer(&dpcm->timer, snd_card_asihpi_timer_function,
+                   (unsigned long) dpcm);
        dpcm->substream = substream;
        runtime->private_data = dpcm;
        runtime->private_free = snd_card_asihpi_runtime_free;
@@ -1246,9 +1244,8 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream)
        if (err)
                return -EIO;
 
-       init_timer(&dpcm->timer);
-       dpcm->timer.data = (unsigned long) dpcm;
-       dpcm->timer.function = snd_card_asihpi_timer_function;
+       setup_timer(&dpcm->timer, snd_card_asihpi_timer_function,
+                   (unsigned long) dpcm);
        dpcm->substream = substream;
        runtime->private_data = dpcm;
        runtime->private_free = snd_card_asihpi_runtime_free;