ALSA: hdsp: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200902040221.354941-6-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Allen Pais 2020-09-02 09:32:16 +05:30 committed by Takashi Iwai
parent c2082393d5
commit 1a1575a151
2 changed files with 6 additions and 7 deletions

View File

@ -3791,9 +3791,9 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
return 0; return 0;
} }
static void hdsp_midi_tasklet(unsigned long arg) static void hdsp_midi_tasklet(struct tasklet_struct *t)
{ {
struct hdsp *hdsp = (struct hdsp *)arg; struct hdsp *hdsp = from_tasklet(hdsp, t, midi_tasklet);
if (hdsp->midi[0].pending) if (hdsp->midi[0].pending)
snd_hdsp_midi_input_read (&hdsp->midi[0]); snd_hdsp_midi_input_read (&hdsp->midi[0]);
@ -5182,7 +5182,7 @@ static int snd_hdsp_create(struct snd_card *card,
spin_lock_init(&hdsp->lock); spin_lock_init(&hdsp->lock);
tasklet_init(&hdsp->midi_tasklet, hdsp_midi_tasklet, (unsigned long)hdsp); tasklet_setup(&hdsp->midi_tasklet, hdsp_midi_tasklet);
pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev); pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
hdsp->firmware_rev &= 0xff; hdsp->firmware_rev &= 0xff;

View File

@ -2169,9 +2169,9 @@ static int snd_hdspm_create_midi(struct snd_card *card,
} }
static void hdspm_midi_tasklet(unsigned long arg) static void hdspm_midi_tasklet(struct tasklet_struct *t)
{ {
struct hdspm *hdspm = (struct hdspm *)arg; struct hdspm *hdspm = from_tasklet(hdspm, t, midi_tasklet);
int i = 0; int i = 0;
while (i < hdspm->midiPorts) { while (i < hdspm->midiPorts) {
@ -6836,8 +6836,7 @@ static int snd_hdspm_create(struct snd_card *card,
} }
tasklet_init(&hdspm->midi_tasklet, tasklet_setup(&hdspm->midi_tasklet, hdspm_midi_tasklet);
hdspm_midi_tasklet, (unsigned long) hdspm);
if (hdspm->io_type != MADIface) { if (hdspm->io_type != MADIface) {