ALSA: gus: Remove always NULL parameters
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 2 Jan 2015 11:24:39 +0000 (12:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jan 2015 15:27:42 +0000 (16:27 +0100)
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>
include/sound/gus.h
sound/isa/gus/gus_pcm.c
sound/isa/gus/gus_uart.c
sound/isa/gus/gusclassic.c
sound/isa/gus/gusextreme.c
sound/isa/gus/gusmax.c
sound/isa/gus/interwave.c

index 42905d811da79db488a2b376668698a861016b5e..06bbdc25917c1bee93582ff33d842e76a3bf20cd 100644 (file)
@@ -591,7 +591,7 @@ int snd_gf1_new_mixer(struct snd_gus_card * gus);
 
 /* gus_pcm.c */
 
-int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm);
+int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index);
 
 #ifdef CONFIG_SND_DEBUG
 extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus);
@@ -620,7 +620,7 @@ void snd_gus_irq_profile_init(struct snd_gus_card *gus);
 
 /* gus_uart.c */
 
-int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi);
+int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device);
 
 /* gus_dram.c */
 int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
index 2dcf45bf7293f1d68a3391226110ce34cc2b721d..25f6788ccef36b3c785843f1a83ceb40716e7333 100644 (file)
@@ -849,7 +849,7 @@ static struct snd_pcm_ops snd_gf1_pcm_capture_ops = {
        .pointer =      snd_gf1_pcm_capture_pointer,
 };
 
-int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm)
+int snd_gf1_pcm_new(struct snd_gus_card *gus, int pcm_dev, int control_index)
 {
        struct snd_card *card;
        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
        struct snd_pcm_substream *substream;
        int capture, err;
 
-       if (rpcm)
-               *rpcm = NULL;
        card = gus->card;
        capture = !gus->interwave && !gus->ess_flag && !gus->ace_flag ? 1 : 0;
        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
                return err;
        kctl->id.index = control_index;
 
-       if (rpcm)
-               *rpcm = pcm;
        return 0;
 }
 
index 21cc42e4c4be8aa91dc5a910f5013e5cb256da73..3992912743f5d3a33cc0a6aa5e027c262f3be55d 100644 (file)
@@ -241,13 +241,11 @@ static struct snd_rawmidi_ops snd_gf1_uart_input =
        .trigger =      snd_gf1_uart_input_trigger,
 };
 
-int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi ** rrawmidi)
+int snd_gf1_rawmidi_new(struct snd_gus_card *gus, int device)
 {
        struct snd_rawmidi *rmidi;
        int err;
 
-       if (rrawmidi)
-               *rrawmidi = NULL;
        if ((err = snd_rawmidi_new(gus->card, "GF1", device, 1, 1, &rmidi)) < 0)
                return err;
        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
        rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
        rmidi->private_data = gus;
        gus->midi_uart = rmidi;
-       if (rrawmidi)
-               *rrawmidi = rmidi;
        return err;
 }
index 7ce29ffa1af9b476ef264cc874591a0d8829415d..f0019715d82ec45cc3fefc58dbecc9d2e06d4352 100644 (file)
@@ -181,12 +181,12 @@ static int snd_gusclassic_probe(struct device *dev, unsigned int n)
        if (error < 0)
                goto out;
 
-       error = snd_gf1_pcm_new(gus, 0, 0, NULL);
+       error = snd_gf1_pcm_new(gus, 0, 0);
        if (error < 0)
                goto out;
 
        if (!gus->ace_flag) {
-               error = snd_gf1_rawmidi_new(gus, 0, NULL);
+               error = snd_gf1_rawmidi_new(gus, 0);
                if (error < 0)
                        goto out;
        }
index acc655284a9c9be87bdcae07ac04394122d8e490..693d95f4680482a4bd38dbd61c30a268215582bf 100644 (file)
@@ -295,7 +295,7 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
        snd_component_add(card, "ES1688");
 
        if (pcm_channels[n] > 0) {
-               error = snd_gf1_pcm_new(gus, 1, 1, NULL);
+               error = snd_gf1_pcm_new(gus, 1, 1);
                if (error < 0)
                        goto out;
        }
index 39df36ca3acbe7438d2dc3bd6e0644683c1f0f53..b2b3734a8e72ce507a71066b6004910f27ae7dab 100644 (file)
@@ -322,14 +322,14 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
                goto _err;
 
        if (pcm_channels[dev] > 0) {
-               if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0)
+               if ((err = snd_gf1_pcm_new(gus, 1, 1)) < 0)
                        goto _err;
        }
        err = snd_gusmax_mixer(wss);
        if (err < 0)
                goto _err;
 
-       err = snd_gf1_rawmidi_new(gus, 0, NULL);
+       err = snd_gf1_rawmidi_new(gus, 0);
        if (err < 0)
                goto _err;
 
index ad55e5cb8e941207f6034593ad5afa996f18b2ff..8ea54a7f78d2349cb4f723839d79cedc3bcf6ac1 100644 (file)
@@ -711,7 +711,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
                return err;
 
        if (pcm_channels[dev] > 0) {
-               err = snd_gf1_pcm_new(gus, 1, 1, NULL);
+               err = snd_gf1_pcm_new(gus, 1, 1);
                if (err < 0)
                        return err;
        }
@@ -740,7 +740,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
 #endif
 
        gus->uart_enable = midi[dev];
-       if ((err = snd_gf1_rawmidi_new(gus, 0, NULL)) < 0)
+       if ((err = snd_gf1_rawmidi_new(gus, 0)) < 0)
                return err;
 
 #ifndef SNDRV_STB