Commit 2a52b6ee authored by Roman Kollar's avatar Roman Kollar Committed by Takashi Iwai

ALSA: dummy: use setup_timer and mod_timer

Use setup_timer and mod_timer instead of structure assignments as it
is the preferred way to setup and set the timer.
Signed-off-by: default avatarRoman Kollar <rkollar@mail.muni.cz>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 53c098bf
...@@ -245,9 +245,8 @@ struct dummy_systimer_pcm { ...@@ -245,9 +245,8 @@ struct dummy_systimer_pcm {
static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm) static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm)
{ {
dpcm->timer.expires = jiffies + mod_timer(&dpcm->timer, jiffies +
(dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate; (dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate);
add_timer(&dpcm->timer);
} }
static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm) static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm)
...@@ -340,9 +339,8 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream) ...@@ -340,9 +339,8 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream)
if (!dpcm) if (!dpcm)
return -ENOMEM; return -ENOMEM;
substream->runtime->private_data = dpcm; substream->runtime->private_data = dpcm;
init_timer(&dpcm->timer); setup_timer(&dpcm->timer, dummy_systimer_callback,
dpcm->timer.data = (unsigned long) dpcm; (unsigned long) dpcm);
dpcm->timer.function = dummy_systimer_callback;
spin_lock_init(&dpcm->lock); spin_lock_init(&dpcm->lock);
dpcm->substream = substream; dpcm->substream = substream;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment