Skip to content

Commit

Permalink
ALSA: hdspm: Use setup_timer() and mod_timer()
Browse files Browse the repository at this point in the history
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 19, 2015
1 parent c41c009 commit 04018e1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,10 +1957,8 @@ static void snd_hdspm_midi_output_timer(unsigned long data)
leaving istimer wherever it was set before.
*/

if (hmidi->istimer) {
hmidi->timer.expires = 1 + jiffies;
add_timer(&hmidi->timer);
}
if (hmidi->istimer)
mod_timer(&hmidi->timer, 1 + jiffies);

spin_unlock_irqrestore (&hmidi->lock, flags);
}
Expand All @@ -1975,11 +1973,9 @@ snd_hdspm_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
spin_lock_irqsave (&hmidi->lock, flags);
if (up) {
if (!hmidi->istimer) {
init_timer(&hmidi->timer);
hmidi->timer.function = snd_hdspm_midi_output_timer;
hmidi->timer.data = (unsigned long) hmidi;
hmidi->timer.expires = 1 + jiffies;
add_timer(&hmidi->timer);
setup_timer(&hmidi->timer, snd_hdspm_midi_output_timer,
(unsigned long) hmidi);
mod_timer(&hmidi->timer, 1 + jiffies);
hmidi->istimer++;
}
} else {
Expand Down

0 comments on commit 04018e1

Please sign in to comment.