diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-19 05:28:54 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-19 05:32:26 -0500 |
commit | f5d5f75fe167c8b80747290968aeaa91457cb10a (patch) | |
tree | 64beb65379de9f9bcd89283e6bf0571e69e78446 | |
parent | 2b1b78114319e0ed2b7ca8c75d9cde6d2bf8f9fc (diff) |
ALSA: opl3: Use setup_timer() and mod_timer()
No functional change, refactoring with the standard helpers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/drivers/opl3/opl3_midi.c | 11 | ||||
-rw-r--r-- | sound/drivers/opl3/opl3_seq.c | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c index 6c6d09a51f42..f62780ed64ad 100644 --- a/sound/drivers/opl3/opl3_midi.c +++ b/sound/drivers/opl3/opl3_midi.c | |||
@@ -258,12 +258,10 @@ void snd_opl3_timer_func(unsigned long data) | |||
258 | spin_unlock_irqrestore(&opl3->voice_lock, flags); | 258 | spin_unlock_irqrestore(&opl3->voice_lock, flags); |
259 | 259 | ||
260 | spin_lock_irqsave(&opl3->sys_timer_lock, flags); | 260 | spin_lock_irqsave(&opl3->sys_timer_lock, flags); |
261 | if (again) { | 261 | if (again) |
262 | opl3->tlist.expires = jiffies + 1; /* invoke again */ | 262 | mod_timer(&opl3->tlist, jiffies + 1); /* invoke again */ |
263 | add_timer(&opl3->tlist); | 263 | else |
264 | } else { | ||
265 | opl3->sys_timer_status = 0; | 264 | opl3->sys_timer_status = 0; |
266 | } | ||
267 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); | 265 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); |
268 | } | 266 | } |
269 | 267 | ||
@@ -275,8 +273,7 @@ static void snd_opl3_start_timer(struct snd_opl3 *opl3) | |||
275 | unsigned long flags; | 273 | unsigned long flags; |
276 | spin_lock_irqsave(&opl3->sys_timer_lock, flags); | 274 | spin_lock_irqsave(&opl3->sys_timer_lock, flags); |
277 | if (! opl3->sys_timer_status) { | 275 | if (! opl3->sys_timer_status) { |
278 | opl3->tlist.expires = jiffies + 1; | 276 | mod_timer(&opl3->tlist, jiffies + 1); |
279 | add_timer(&opl3->tlist); | ||
280 | opl3->sys_timer_status = 1; | 277 | opl3->sys_timer_status = 1; |
281 | } | 278 | } |
282 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); | 279 | spin_unlock_irqrestore(&opl3->sys_timer_lock, flags); |
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index 68399538e435..a9f618e06a22 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c | |||
@@ -247,9 +247,7 @@ static int snd_opl3_seq_new_device(struct snd_seq_device *dev) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | /* setup system timer */ | 249 | /* setup system timer */ |
250 | init_timer(&opl3->tlist); | 250 | setup_timer(&opl3->tlist, snd_opl3_timer_func, (unsigned long) opl3); |
251 | opl3->tlist.function = snd_opl3_timer_func; | ||
252 | opl3->tlist.data = (unsigned long) opl3; | ||
253 | spin_lock_init(&opl3->sys_timer_lock); | 251 | spin_lock_init(&opl3->sys_timer_lock); |
254 | opl3->sys_timer_status = 0; | 252 | opl3->sys_timer_status = 0; |
255 | 253 | ||