mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-11 23:27:42 +07:00
ALSA: cs4281: Remove always NULL parameters
snd_cs4281_pcm() and snd_cs4281_midi() take a pointer to a pointer of a PCM/MIDI object where if this parameter is provided the newly allocated object is stored. All callers pass NULL though, so remove the parameter. This makes the code a bit shorter and cleaner. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d18132aa15
commit
3e4f4776f4
@ -973,14 +973,11 @@ static struct snd_pcm_ops snd_cs4281_capture_ops = {
|
|||||||
.pointer = snd_cs4281_pointer,
|
.pointer = snd_cs4281_pointer,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int snd_cs4281_pcm(struct cs4281 *chip, int device,
|
static int snd_cs4281_pcm(struct cs4281 *chip, int device)
|
||||||
struct snd_pcm **rpcm)
|
|
||||||
{
|
{
|
||||||
struct snd_pcm *pcm;
|
struct snd_pcm *pcm;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (rpcm)
|
|
||||||
*rpcm = NULL;
|
|
||||||
err = snd_pcm_new(chip->card, "CS4281", device, 1, 1, &pcm);
|
err = snd_pcm_new(chip->card, "CS4281", device, 1, 1, &pcm);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
@ -996,8 +993,6 @@ static int snd_cs4281_pcm(struct cs4281 *chip, int device,
|
|||||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
||||||
snd_dma_pci_data(chip->pci), 64*1024, 512*1024);
|
snd_dma_pci_data(chip->pci), 64*1024, 512*1024);
|
||||||
|
|
||||||
if (rpcm)
|
|
||||||
*rpcm = pcm;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1788,14 +1783,11 @@ static struct snd_rawmidi_ops snd_cs4281_midi_input =
|
|||||||
.trigger = snd_cs4281_midi_input_trigger,
|
.trigger = snd_cs4281_midi_input_trigger,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int snd_cs4281_midi(struct cs4281 *chip, int device,
|
static int snd_cs4281_midi(struct cs4281 *chip, int device)
|
||||||
struct snd_rawmidi **rrawmidi)
|
|
||||||
{
|
{
|
||||||
struct snd_rawmidi *rmidi;
|
struct snd_rawmidi *rmidi;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (rrawmidi)
|
|
||||||
*rrawmidi = NULL;
|
|
||||||
if ((err = snd_rawmidi_new(chip->card, "CS4281", device, 1, 1, &rmidi)) < 0)
|
if ((err = snd_rawmidi_new(chip->card, "CS4281", device, 1, 1, &rmidi)) < 0)
|
||||||
return err;
|
return err;
|
||||||
strcpy(rmidi->name, "CS4281");
|
strcpy(rmidi->name, "CS4281");
|
||||||
@ -1804,8 +1796,6 @@ static int snd_cs4281_midi(struct cs4281 *chip, int device,
|
|||||||
rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
|
rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
|
||||||
rmidi->private_data = chip;
|
rmidi->private_data = chip;
|
||||||
chip->rmidi = rmidi;
|
chip->rmidi = rmidi;
|
||||||
if (rrawmidi)
|
|
||||||
*rrawmidi = rmidi;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1941,11 +1931,11 @@ static int snd_cs4281_probe(struct pci_dev *pci,
|
|||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
if ((err = snd_cs4281_pcm(chip, 0, NULL)) < 0) {
|
if ((err = snd_cs4281_pcm(chip, 0)) < 0) {
|
||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
if ((err = snd_cs4281_midi(chip, 0, NULL)) < 0) {
|
if ((err = snd_cs4281_midi(chip, 0)) < 0) {
|
||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user