diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-24 08:34:58 -0700 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-10-25 09:51:21 +0200 |
commit | 4f928246f0e8f9bda88f41131ec447a1b8193dbc (patch) | |
tree | 1d6cf9500b82aeceb704427768b936fdabfbd771 /sound/isa/sb/sb8_midi.c | |
parent | 57e69e2f06e8fe4949c54e438c9faae0731e92f8 (diff) | |
download | blackbird-obmc-linux-4f928246f0e8f9bda88f41131ec447a1b8193dbc.tar.gz blackbird-obmc-linux-4f928246f0e8f9bda88f41131ec447a1b8193dbc.zip |
ALSA: sb: 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.
[Re-use the existing chip->midi_substream_output instead of assigning
a new field to struct snd_sb -- tiwai]
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/sb/sb8_midi.c')
-rw-r--r-- | sound/isa/sb/sb8_midi.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/isa/sb/sb8_midi.c b/sound/isa/sb/sb8_midi.c index bd672abb4854..05ba2c6b1a8c 100644 --- a/sound/isa/sb/sb8_midi.c +++ b/sound/isa/sb/sb8_midi.c @@ -209,10 +209,10 @@ static void snd_sb8dsp_midi_output_write(struct snd_rawmidi_substream *substream } } -static void snd_sb8dsp_midi_output_timer(unsigned long data) +static void snd_sb8dsp_midi_output_timer(struct timer_list *t) { - struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *) data; - struct snd_sb * chip = substream->rmidi->private_data; + struct snd_sb *chip = from_timer(chip, t, midi_timer); + struct snd_rawmidi_substream *substream = chip->midi_substream_output; unsigned long flags; spin_lock_irqsave(&chip->open_lock, flags); @@ -230,9 +230,8 @@ static void snd_sb8dsp_midi_output_trigger(struct snd_rawmidi_substream *substre spin_lock_irqsave(&chip->open_lock, flags); if (up) { if (!(chip->open & SB_OPEN_MIDI_OUTPUT_TRIGGER)) { - setup_timer(&chip->midi_timer, - snd_sb8dsp_midi_output_timer, - (unsigned long) substream); + timer_setup(&chip->midi_timer, + snd_sb8dsp_midi_output_timer, 0); mod_timer(&chip->midi_timer, 1 + jiffies); chip->open |= SB_OPEN_MIDI_OUTPUT_TRIGGER; } |