Commit abd08352 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: emux: Use setup_timer() and mod_timer()

No functional change, refactoring with the standard helpers.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent da1a3924
...@@ -53,9 +53,7 @@ int snd_emux_new(struct snd_emux **remu) ...@@ -53,9 +53,7 @@ int snd_emux_new(struct snd_emux **remu)
emu->max_voices = 0; emu->max_voices = 0;
emu->use_time = 0; emu->use_time = 0;
init_timer(&emu->tlist); setup_timer(&emu->tlist, snd_emux_timer_callback, (unsigned long)emu);
emu->tlist.function = snd_emux_timer_callback;
emu->tlist.data = (unsigned long)emu;
emu->timer_active = 0; emu->timer_active = 0;
*remu = emu; *remu = emu;
......
...@@ -186,8 +186,7 @@ snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan) ...@@ -186,8 +186,7 @@ snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
*/ */
vp->state = SNDRV_EMUX_ST_PENDING; vp->state = SNDRV_EMUX_ST_PENDING;
if (! emu->timer_active) { if (! emu->timer_active) {
emu->tlist.expires = jiffies + 1; mod_timer(&emu->tlist, jiffies + 1);
add_timer(&emu->tlist);
emu->timer_active = 1; emu->timer_active = 1;
} }
} else } else
...@@ -223,8 +222,7 @@ void snd_emux_timer_callback(unsigned long data) ...@@ -223,8 +222,7 @@ void snd_emux_timer_callback(unsigned long data)
} }
} }
if (do_again) { if (do_again) {
emu->tlist.expires = jiffies + 1; mod_timer(&emu->tlist, jiffies + 1);
add_timer(&emu->tlist);
emu->timer_active = 1; emu->timer_active = 1;
} else } else
emu->timer_active = 0; emu->timer_active = 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