aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/gus
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-02 06:24:43 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-02 10:30:08 -0500
commitfa60c065694a81e534c61809ab7dd419366e9335 (patch)
treecf48dbdcbfdc171ebad6e34be90d436e676c4e13 /sound/isa/gus
parent92533f188862fbefe357ada4e4af67b8e730e680 (diff)
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/gus')
-rw-r--r--sound/isa/gus/gusmax.c4
-rw-r--r--sound/isa/gus/interwave.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index b2b3734a8e72..8216e8d8f017 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -309,7 +309,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
309 if (err < 0) 309 if (err < 0)
310 goto _err; 310 goto _err;
311 311
312 err = snd_wss_pcm(wss, 0, NULL); 312 err = snd_wss_pcm(wss, 0);
313 if (err < 0) 313 if (err < 0)
314 goto _err; 314 goto _err;
315 315
@@ -317,7 +317,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
317 if (err < 0) 317 if (err < 0)
318 goto _err; 318 goto _err;
319 319
320 err = snd_wss_timer(wss, 2, NULL); 320 err = snd_wss_timer(wss, 2);
321 if (err < 0) 321 if (err < 0)
322 goto _err; 322 goto _err;
323 323
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 8ea54a7f78d2..70d0040484c8 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -647,7 +647,6 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
647#ifdef SNDRV_STB 647#ifdef SNDRV_STB
648 struct snd_i2c_bus *i2c_bus; 648 struct snd_i2c_bus *i2c_bus;
649#endif 649#endif
650 struct snd_pcm *pcm;
651 char *str; 650 char *str;
652 int err; 651 int err;
653 652
@@ -695,14 +694,15 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
695 if (err < 0) 694 if (err < 0)
696 return err; 695 return err;
697 696
698 err = snd_wss_pcm(wss, 0, &pcm); 697 err = snd_wss_pcm(wss, 0);
699 if (err < 0) 698 if (err < 0)
700 return err; 699 return err;
701 700
702 sprintf(pcm->name + strlen(pcm->name), " rev %c", gus->revision + 'A'); 701 sprintf(wss->pcm->name + strlen(wss->pcm->name), " rev %c",
703 strcat(pcm->name, " (codec)"); 702 gus->revision + 'A');
703 strcat(wss->pcm->name, " (codec)");
704 704
705 err = snd_wss_timer(wss, 2, NULL); 705 err = snd_wss_timer(wss, 2);
706 if (err < 0) 706 if (err < 0)
707 return err; 707 return err;
708 708