aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
authorRoman Kollar <rkollar@mail.muni.cz>2015-01-19 04:42:54 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-19 04:49:52 -0500
commit2a52b6eef7386cc19dfc0a2e82a7e23d807e51e5 (patch)
treecfd7bb68379539179fac81efa06ea731bdfb8d02 /sound/drivers
parent53c098bfc5b614cd28c416215f5fa68815f1cce9 (diff)
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: Roman Kollar <rkollar@mail.muni.cz> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
-rw-r--r--sound/drivers/dummy.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 5d0dfb787cec..d11baaf0f0b4 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -245,9 +245,8 @@ struct dummy_systimer_pcm {
245 245
246static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm) 246static void dummy_systimer_rearm(struct dummy_systimer_pcm *dpcm)
247{ 247{
248 dpcm->timer.expires = jiffies + 248 mod_timer(&dpcm->timer, jiffies +
249 (dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate; 249 (dpcm->frac_period_rest + dpcm->rate - 1) / dpcm->rate);
250 add_timer(&dpcm->timer);
251} 250}
252 251
253static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm) 252static void dummy_systimer_update(struct dummy_systimer_pcm *dpcm)
@@ -340,9 +339,8 @@ static int dummy_systimer_create(struct snd_pcm_substream *substream)
340 if (!dpcm) 339 if (!dpcm)
341 return -ENOMEM; 340 return -ENOMEM;
342 substream->runtime->private_data = dpcm; 341 substream->runtime->private_data = dpcm;
343 init_timer(&dpcm->timer); 342 setup_timer(&dpcm->timer, dummy_systimer_callback,
344 dpcm->timer.data = (unsigned long) dpcm; 343 (unsigned long) dpcm);
345 dpcm->timer.function = dummy_systimer_callback;
346 spin_lock_init(&dpcm->lock); 344 spin_lock_init(&dpcm->lock);
347 dpcm->substream = substream; 345 dpcm->substream = substream;
348 return 0; 346 return 0;