ALSA: wss: Remove (almost) always NULL parameters
Most callers of snd_wss_pcm(), snd_wss_timer() and snd_cs4236_pcm() pass NULL as the last parameter, some callers pass a pointer but never use it after the function has been called and only a few callers pass a pointer and actually use it. The later is only the case for snd_wss_pcm() for snd_cs4236_pcm() and it is possible to get the same PCM object by accessing the pcm field of the snd_wss struct that was passed as the first parameter. This function removes the last parameters from the functions mentioned above and updates the callers which used it to use chip->pcm instead. This allows us to slightly simplify the functions since they don't have to check and set the last parameter anymore which makes the code slightly 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:

committed by
Takashi Iwai

orang tua
92533f1888
melakukan
fa60c06569
@@ -309,7 +309,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
|
||||
err = snd_wss_pcm(wss, 0, NULL);
|
||||
err = snd_wss_pcm(wss, 0);
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
|
||||
@@ -317,7 +317,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
|
||||
err = snd_wss_timer(wss, 2, NULL);
|
||||
err = snd_wss_timer(wss, 2);
|
||||
if (err < 0)
|
||||
goto _err;
|
||||
|
||||
|
@@ -647,7 +647,6 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
|
||||
#ifdef SNDRV_STB
|
||||
struct snd_i2c_bus *i2c_bus;
|
||||
#endif
|
||||
struct snd_pcm *pcm;
|
||||
char *str;
|
||||
int err;
|
||||
|
||||
@@ -695,14 +694,15 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
err = snd_wss_pcm(wss, 0, &pcm);
|
||||
err = snd_wss_pcm(wss, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
sprintf(pcm->name + strlen(pcm->name), " rev %c", gus->revision + 'A');
|
||||
strcat(pcm->name, " (codec)");
|
||||
sprintf(wss->pcm->name + strlen(wss->pcm->name), " rev %c",
|
||||
gus->revision + 'A');
|
||||
strcat(wss->pcm->name, " (codec)");
|
||||
|
||||
err = snd_wss_timer(wss, 2, NULL);
|
||||
err = snd_wss_timer(wss, 2);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
Reference in New Issue
Block a user