summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-10-05 15:08:57 +0200
committerTakashi Iwai <tiwai@suse.de>2017-10-05 15:08:57 +0200
commit3a9fce327ff9cabf7f89d3f20616a83af28393da (patch)
treec516d3e7023e7fe2dc8d4cf60e2ec03f3c9b5958 /sound/core
parente195a331c4124a6527e5e1b6fbd93a6b4a984d7b (diff)
parent394ca81cb4c1518e9463fe342fb1ae8a9f46a82d (diff)
Merge branch 'topic/timer-api' into for-next
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/timer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 6cdd04a45962..09acaf2b2e57 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -1028,15 +1028,17 @@ EXPORT_SYMBOL(snd_timer_global_register);
struct snd_timer_system_private {
struct timer_list tlist;
+ struct snd_timer *snd_timer;
unsigned long last_expires;
unsigned long last_jiffies;
unsigned long correction;
};
-static void snd_timer_s_function(unsigned long data)
+static void snd_timer_s_function(struct timer_list *t)
{
- struct snd_timer *timer = (struct snd_timer *)data;
- struct snd_timer_system_private *priv = timer->private_data;
+ struct snd_timer_system_private *priv = from_timer(priv, t,
+ tlist);
+ struct snd_timer *timer = priv->snd_timer;
unsigned long jiff = jiffies;
if (time_after(jiff, priv->last_expires))
priv->correction += (long)jiff - (long)priv->last_expires;
@@ -1118,7 +1120,8 @@ static int snd_timer_register_system(void)
snd_timer_free(timer);
return -ENOMEM;
}
- setup_timer(&priv->tlist, snd_timer_s_function, (unsigned long) timer);
+ priv->snd_timer = timer;
+ timer_setup(&priv->tlist, snd_timer_s_function, 0);
timer->private_data = priv;
timer->private_free = snd_timer_free_system;
return snd_timer_global_register(timer);