Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c41c009e authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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



No functional change, refactoring with the standard helpers.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3d6f0e0c
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -1428,10 +1428,8 @@ static void snd_hdsp_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);
}
@@ -1445,11 +1443,9 @@ static void snd_hdsp_midi_output_trigger(struct snd_rawmidi_substream *substream
	spin_lock_irqsave (&hmidi->lock, flags);
	if (up) {
		if (!hmidi->istimer) {
			init_timer(&hmidi->timer);
			hmidi->timer.function = snd_hdsp_midi_output_timer;
			hmidi->timer.data = (unsigned long) hmidi;
			hmidi->timer.expires = 1 + jiffies;
			add_timer(&hmidi->timer);
			setup_timer(&hmidi->timer, snd_hdsp_midi_output_timer,
				    (unsigned long) hmidi);
			mod_timer(&hmidi->timer, 1 + jiffies);
			hmidi->istimer++;
		}
	} else {