Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: wavefront: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Kees Cook and committed by
Takashi Iwai
57e69e2f 08352b20

+6 -5
+1
include/sound/snd_wavefront.h
··· 28 28 struct snd_rawmidi_substream *substream_output[2]; 29 29 struct snd_rawmidi_substream *substream_input[2]; 30 30 struct timer_list timer; 31 + snd_wavefront_card_t *timer_card; 31 32 spinlock_t open; 32 33 spinlock_t virtual; /* protects isvirtual */ 33 34 };
+5 -5
sound/isa/wavefront/wavefront_midi.c
··· 349 349 spin_unlock_irqrestore (&midi->virtual, flags); 350 350 } 351 351 352 - static void snd_wavefront_midi_output_timer(unsigned long data) 352 + static void snd_wavefront_midi_output_timer(struct timer_list *t) 353 353 { 354 - snd_wavefront_card_t *card = (snd_wavefront_card_t *)data; 355 - snd_wavefront_midi_t *midi = &card->wavefront.midi; 354 + snd_wavefront_midi_t *midi = from_timer(midi, t, timer); 355 + snd_wavefront_card_t *card = midi->timer_card; 356 356 unsigned long flags; 357 357 358 358 spin_lock_irqsave (&midi->virtual, flags); ··· 383 383 if (up) { 384 384 if ((midi->mode[mpu] & MPU401_MODE_OUTPUT_TRIGGER) == 0) { 385 385 if (!midi->istimer) { 386 - setup_timer(&midi->timer, 386 + timer_setup(&midi->timer, 387 387 snd_wavefront_midi_output_timer, 388 - (unsigned long) substream->rmidi->card->private_data); 388 + 0); 389 389 mod_timer(&midi->timer, 1 + jiffies); 390 390 } 391 391 midi->istimer++;