diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-02 12:24:43 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-02 16:30:08 +0100 |
commit | fa60c065694a81e534c61809ab7dd419366e9335 (patch) | |
tree | cf48dbdcbfdc171ebad6e34be90d436e676c4e13 /sound/isa/opti9xx/opti92x-ad1848.c | |
parent | 92533f188862fbefe357ada4e4af67b8e730e680 (diff) | |
download | linux-fa60c065694a81e534c61809ab7dd419366e9335.tar.bz2 |
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>
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index c9b582848603..840831f1dd4e 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -820,10 +820,6 @@ static int snd_opti9xx_probe(struct snd_card *card) int xdma2; struct snd_opti9xx *chip = card->private_data; struct snd_wss *codec; -#ifdef CS4231 - struct snd_timer *timer; -#endif - struct snd_pcm *pcm; struct snd_rawmidi *rmidi; struct snd_hwdep *synth; @@ -855,7 +851,7 @@ static int snd_opti9xx_probe(struct snd_card *card) if (error < 0) return error; chip->codec = codec; - error = snd_wss_pcm(codec, 0, &pcm); + error = snd_wss_pcm(codec, 0); if (error < 0) return error; error = snd_wss_mixer(codec); @@ -867,7 +863,7 @@ static int snd_opti9xx_probe(struct snd_card *card) return error; #endif #ifdef CS4231 - error = snd_wss_timer(codec, 0, &timer); + error = snd_wss_timer(codec, 0); if (error < 0) return error; #endif @@ -884,11 +880,12 @@ static int snd_opti9xx_probe(struct snd_card *card) sprintf(card->shortname, "OPTi %s", card->driver); #if defined(CS4231) || defined(OPTi93X) sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d", - card->shortname, pcm->name, + card->shortname, codec->pcm->name, chip->wss_base + 4, irq, dma1, xdma2); #else sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d", - card->shortname, pcm->name, chip->wss_base + 4, irq, dma1); + card->shortname, codec->pcm->name, chip->wss_base + 4, irq, + dma1); #endif /* CS4231 || OPTi93X */ if (mpu_port <= 0 || mpu_port == SNDRV_AUTO_PORT) |