Commit 04018e13 authored by Takashi Iwai's avatar Takashi Iwai

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

No functional change, refactoring with the standard helpers.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c41c009e
...@@ -1957,10 +1957,8 @@ static void snd_hdspm_midi_output_timer(unsigned long data) ...@@ -1957,10 +1957,8 @@ static void snd_hdspm_midi_output_timer(unsigned long data)
leaving istimer wherever it was set before. leaving istimer wherever it was set before.
*/ */
if (hmidi->istimer) { if (hmidi->istimer)
hmidi->timer.expires = 1 + jiffies; mod_timer(&hmidi->timer, 1 + jiffies);
add_timer(&hmidi->timer);
}
spin_unlock_irqrestore (&hmidi->lock, flags); spin_unlock_irqrestore (&hmidi->lock, flags);
} }
...@@ -1975,11 +1973,9 @@ snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) ...@@ -1975,11 +1973,9 @@ snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
spin_lock_irqsave (&hmidi->lock, flags); spin_lock_irqsave (&hmidi->lock, flags);
if (up) { if (up) {
if (!hmidi->istimer) { if (!hmidi->istimer) {
init_timer(&hmidi->timer); setup_timer(&hmidi->timer, snd_hdspm_midi_output_timer,
hmidi->timer.function = snd_hdspm_midi_output_timer; (unsigned long) hmidi);
hmidi->timer.data = (unsigned long) hmidi; mod_timer(&hmidi->timer, 1 + jiffies);
hmidi->timer.expires = 1 + jiffies;
add_timer(&hmidi->timer);
hmidi->istimer++; hmidi->istimer++;
} }
} else { } else {
......
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