diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-02 06:24:39 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-02 10:27:42 -0500 |
commit | db5abb3c499e553a8afedee1417d6a6308dda7bd (patch) | |
tree | 2a6eb4c020771ae768a7f6795855a968d83631e3 /sound/isa/gus | |
parent | 1a2515ac94bbb1c409dea2e4a7b011592569b239 (diff) |
ALSA: gus: Remove always NULL parameters
snd_gf1_pcm_new() and snd_gf1_rawmidi_new() take a pointer to a pointer of a
PCM/MIDI 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 cleaner and shorter.
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/gus_pcm.c | 6 | ||||
-rw-r--r-- | sound/isa/gus/gus_uart.c | 6 | ||||
-rw-r--r-- | sound/isa/gus/gusclassic.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/gusextreme.c | 2 | ||||
-rw-r--r-- | sound/isa/gus/gusmax.c | 4 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 4 |
6 files changed, 9 insertions, 17 deletions
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 2dcf45bf7293..25f6788ccef3 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c | |||
@@ -849,7 +849,7 @@ static struct snd_pcm_ops snd_gf1_pcm_capture_ops = { | |||
849 | .pointer = snd_gf1_pcm_capture_pointer, | 849 | .pointer = snd_gf1_pcm_capture_pointer, |
850 | }; | 850 | }; |
851 | 851 | ||
852 | int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm) | 852 | int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index) |
853 | { | 853 | { |
854 | struct snd_card *card; | 854 | struct snd_card *card; |
855 | struct snd_kcontrol *kctl; | 855 | struct snd_kcontrol *kctl; |
@@ -857,8 +857,6 @@ int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, s | |||
857 | struct snd_pcm_substream *substream; | 857 | struct snd_pcm_substream *substream; |
858 | int capture, err; | 858 | int capture, err; |
859 | 859 | ||
860 | if (rpcm) | ||
861 | *rpcm = NULL; | ||
862 | card = gus->card; | 860 | card = gus->card; |
863 | capture = !gus->interwave && !gus->ess_flag && !gus->ace_flag ? 1 : 0; | 861 | capture = !gus->interwave && !gus->ess_flag && !gus->ace_flag ? 1 : 0; |
864 | err = snd_pcm_new(card, | 862 | err = snd_pcm_new(card, |
@@ -903,8 +901,6 @@ int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, s | |||
903 | return err; | 901 | return err; |
904 | kctl->id.index = control_index; | 902 | kctl->id.index = control_index; |
905 | 903 | ||
906 | if (rpcm) | ||
907 | *rpcm = pcm; | ||
908 | return 0; | 904 | return 0; |
909 | } | 905 | } |
910 | 906 | ||
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c index 21cc42e4c4be..3992912743f5 100644 --- a/sound/isa/gus/gus_uart.c +++ b/sound/isa/gus/gus_uart.c | |||
@@ -241,13 +241,11 @@ static struct snd_rawmidi_ops snd_gf1_uart_input = | |||
241 | .trigger = snd_gf1_uart_input_trigger, | 241 | .trigger = snd_gf1_uart_input_trigger, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi ** rrawmidi) | 244 | int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device) |
245 | { | 245 | { |
246 | struct snd_rawmidi *rmidi; | 246 | struct snd_rawmidi *rmidi; |
247 | int err; | 247 | int err; |
248 | 248 | ||
249 | if (rrawmidi) | ||
250 | *rrawmidi = NULL; | ||
251 | if ((err = snd_rawmidi_new(gus->card, "GF1", device, 1, 1, &rmidi)) < 0) | 249 | if ((err = snd_rawmidi_new(gus->card, "GF1", device, 1, 1, &rmidi)) < 0) |
252 | return err; | 250 | return err; |
253 | strcpy(rmidi->name, gus->interwave ? "AMD InterWave" : "GF1"); | 251 | strcpy(rmidi->name, gus->interwave ? "AMD InterWave" : "GF1"); |
@@ -256,7 +254,5 @@ int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmid | |||
256 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX; | 254 | rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX; |
257 | rmidi->private_data = gus; | 255 | rmidi->private_data = gus; |
258 | gus->midi_uart = rmidi; | 256 | gus->midi_uart = rmidi; |
259 | if (rrawmidi) | ||
260 | *rrawmidi = rmidi; | ||
261 | return err; | 257 | return err; |
262 | } | 258 | } |
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 7ce29ffa1af9..f0019715d82e 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -181,12 +181,12 @@ static int snd_gusclassic_probe(struct device *dev, unsigned int n) | |||
181 | if (error < 0) | 181 | if (error < 0) |
182 | goto out; | 182 | goto out; |
183 | 183 | ||
184 | error = snd_gf1_pcm_new(gus, 0, 0, NULL); | 184 | error = snd_gf1_pcm_new(gus, 0, 0); |
185 | if (error < 0) | 185 | if (error < 0) |
186 | goto out; | 186 | goto out; |
187 | 187 | ||
188 | if (!gus->ace_flag) { | 188 | if (!gus->ace_flag) { |
189 | error = snd_gf1_rawmidi_new(gus, 0, NULL); | 189 | error = snd_gf1_rawmidi_new(gus, 0); |
190 | if (error < 0) | 190 | if (error < 0) |
191 | goto out; | 191 | goto out; |
192 | } | 192 | } |
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index acc655284a9c..693d95f46804 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -295,7 +295,7 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n) | |||
295 | snd_component_add(card, "ES1688"); | 295 | snd_component_add(card, "ES1688"); |
296 | 296 | ||
297 | if (pcm_channels[n] > 0) { | 297 | if (pcm_channels[n] > 0) { |
298 | error = snd_gf1_pcm_new(gus, 1, 1, NULL); | 298 | error = snd_gf1_pcm_new(gus, 1, 1); |
299 | if (error < 0) | 299 | if (error < 0) |
300 | goto out; | 300 | goto out; |
301 | } | 301 | } |
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c index 39df36ca3acb..b2b3734a8e72 100644 --- a/sound/isa/gus/gusmax.c +++ b/sound/isa/gus/gusmax.c | |||
@@ -322,14 +322,14 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev) | |||
322 | goto _err; | 322 | goto _err; |
323 | 323 | ||
324 | if (pcm_channels[dev] > 0) { | 324 | if (pcm_channels[dev] > 0) { |
325 | if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) | 325 | if ((err = snd_gf1_pcm_new(gus, 1, 1)) < 0) |
326 | goto _err; | 326 | goto _err; |
327 | } | 327 | } |
328 | err = snd_gusmax_mixer(wss); | 328 | err = snd_gusmax_mixer(wss); |
329 | if (err < 0) | 329 | if (err < 0) |
330 | goto _err; | 330 | goto _err; |
331 | 331 | ||
332 | err = snd_gf1_rawmidi_new(gus, 0, NULL); | 332 | err = snd_gf1_rawmidi_new(gus, 0); |
333 | if (err < 0) | 333 | if (err < 0) |
334 | goto _err; | 334 | goto _err; |
335 | 335 | ||
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index ad55e5cb8e94..8ea54a7f78d2 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -711,7 +711,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev) | |||
711 | return err; | 711 | return err; |
712 | 712 | ||
713 | if (pcm_channels[dev] > 0) { | 713 | if (pcm_channels[dev] > 0) { |
714 | err = snd_gf1_pcm_new(gus, 1, 1, NULL); | 714 | err = snd_gf1_pcm_new(gus, 1, 1); |
715 | if (err < 0) | 715 | if (err < 0) |
716 | return err; | 716 | return err; |
717 | } | 717 | } |
@@ -740,7 +740,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev) | |||
740 | #endif | 740 | #endif |
741 | 741 | ||
742 | gus->uart_enable = midi[dev]; | 742 | gus->uart_enable = midi[dev]; |
743 | if ((err = snd_gf1_rawmidi_new(gus, 0, NULL)) < 0) | 743 | if ((err = snd_gf1_rawmidi_new(gus, 0)) < 0) |
744 | return err; | 744 | return err; |
745 | 745 | ||
746 | #ifndef SNDRV_STB | 746 | #ifndef SNDRV_STB |