ALSA: es1688: Remove almost always NULL parameter
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 2 Jan 2015 11:24:37 +0000 (12:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jan 2015 15:27:03 +0000 (16:27 +0100)
snd_es1688_pcm() takes a pointer to a pointer of a PCM where if this
parameter is provided the newly allocated PCM is stored. This PCM is also
available from the pcm field of the snd_es1688 struct that got passed to the
same function. This patch updates all callers which passed a pointer to use
that field instead and then removes the parameter from the function. This
makes the code a bit shorter and cleaner.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/es1688.h
sound/isa/es1688/es1688.c
sound/isa/es1688/es1688_lib.c
sound/isa/gus/gusextreme.c

index 1d636a2d8896e30e9c1f801bbe6ee1c435cbc703..b34f23a5bb74a35f8be07b462af23b18eb80544a 100644 (file)
@@ -115,8 +115,7 @@ int snd_es1688_create(struct snd_card *card,
                      int mpu_irq,
                      int dma8,
                      unsigned short hardware);
-int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device,
-                  struct snd_pcm **rpcm);
+int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device);
 int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip);
 int snd_es1688_reset(struct snd_es1688 *chip);
 
index 76001fe0579da1942620ae97f1c0e8bed4aa67fa..1901c2bb6c3bca0cb0ace9a95617f5137a6fa07a 100644 (file)
@@ -138,10 +138,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
 {
        struct snd_es1688 *chip = card->private_data;
        struct snd_opl3 *opl3;
-       struct snd_pcm *pcm;
        int error;
 
-       error = snd_es1688_pcm(card, chip, 0, &pcm);
+       error = snd_es1688_pcm(card, chip, 0);
        if (error < 0)
                return error;
 
@@ -150,9 +149,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
                return error;
 
        strlcpy(card->driver, "ES1688", sizeof(card->driver));
-       strlcpy(card->shortname, pcm->name, sizeof(card->shortname));
+       strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
        snprintf(card->longname, sizeof(card->longname),
-               "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port,
+               "%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
                 chip->irq, chip->dma8);
 
        if (fm_port[n] == SNDRV_AUTO_PORT)
index b5450143407b2f43041921c081b16e973899986e..52aac846717845e114ed7ff39441673522609c6c 100644 (file)
@@ -728,8 +728,7 @@ static struct snd_pcm_ops snd_es1688_capture_ops = {
        .pointer =              snd_es1688_capture_pointer,
 };
 
-int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip,
-                  int device, struct snd_pcm **rpcm)
+int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device)
 {
        struct snd_pcm *pcm;
        int err;
@@ -749,9 +748,6 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip,
        snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
                                              snd_dma_isa_data(),
                                              64*1024, 64*1024);
-
-       if (rpcm)
-               *rpcm = pcm;
        return 0;
 }
 
index 28a16936a397b71207b88504cd6ee1fc0e8ad82a..acc655284a9c9be87bdcae07ac04394122d8e490 100644 (file)
@@ -284,7 +284,7 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
        }
        gus->codec_flag = 1;
 
-       error = snd_es1688_pcm(card, es1688, 0, NULL);
+       error = snd_es1688_pcm(card, es1688, 0);
        if (error < 0)
                goto out;
 
This page took 0.027374 seconds and 5 git commands to generate.