aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-02 06:24:37 -0500
committerTakashi Iwai <tiwai@suse.de>2015-01-02 10:27:03 -0500
commit4b8ab88518726197c8659bc9aca96c6af01dab57 (patch)
treedd248ea06b8d5c9102889768cffc448e2d2e25a0
parent7f605418837add961466dc66f7370332d44c1a92 (diff)
ALSA: es1688: Remove almost always NULL parameter
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>
-rw-r--r--include/sound/es1688.h3
-rw-r--r--sound/isa/es1688/es1688.c7
-rw-r--r--sound/isa/es1688/es1688_lib.c6
-rw-r--r--sound/isa/gus/gusextreme.c2
4 files changed, 6 insertions, 12 deletions
diff --git a/include/sound/es1688.h b/include/sound/es1688.h
index 1d636a2d8896..b34f23a5bb74 100644
--- a/include/sound/es1688.h
+++ b/include/sound/es1688.h
@@ -115,8 +115,7 @@ int snd_es1688_create(struct snd_card *card,
115 int mpu_irq, 115 int mpu_irq,
116 int dma8, 116 int dma8,
117 unsigned short hardware); 117 unsigned short hardware);
118int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device, 118int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device);
119 struct snd_pcm **rpcm);
120int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip); 119int snd_es1688_mixer(struct snd_card *card, struct snd_es1688 *chip);
121int snd_es1688_reset(struct snd_es1688 *chip); 120int snd_es1688_reset(struct snd_es1688 *chip);
122 121
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 76001fe0579d..1901c2bb6c3b 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -138,10 +138,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
138{ 138{
139 struct snd_es1688 *chip = card->private_data; 139 struct snd_es1688 *chip = card->private_data;
140 struct snd_opl3 *opl3; 140 struct snd_opl3 *opl3;
141 struct snd_pcm *pcm;
142 int error; 141 int error;
143 142
144 error = snd_es1688_pcm(card, chip, 0, &pcm); 143 error = snd_es1688_pcm(card, chip, 0);
145 if (error < 0) 144 if (error < 0)
146 return error; 145 return error;
147 146
@@ -150,9 +149,9 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
150 return error; 149 return error;
151 150
152 strlcpy(card->driver, "ES1688", sizeof(card->driver)); 151 strlcpy(card->driver, "ES1688", sizeof(card->driver));
153 strlcpy(card->shortname, pcm->name, sizeof(card->shortname)); 152 strlcpy(card->shortname, chip->pcm->name, sizeof(card->shortname));
154 snprintf(card->longname, sizeof(card->longname), 153 snprintf(card->longname, sizeof(card->longname),
155 "%s at 0x%lx, irq %i, dma %i", pcm->name, chip->port, 154 "%s at 0x%lx, irq %i, dma %i", chip->pcm->name, chip->port,
156 chip->irq, chip->dma8); 155 chip->irq, chip->dma8);
157 156
158 if (fm_port[n] == SNDRV_AUTO_PORT) 157 if (fm_port[n] == SNDRV_AUTO_PORT)
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index b5450143407b..52aac8467178 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -728,8 +728,7 @@ static struct snd_pcm_ops snd_es1688_capture_ops = {
728 .pointer = snd_es1688_capture_pointer, 728 .pointer = snd_es1688_capture_pointer,
729}; 729};
730 730
731int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, 731int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip, int device)
732 int device, struct snd_pcm **rpcm)
733{ 732{
734 struct snd_pcm *pcm; 733 struct snd_pcm *pcm;
735 int err; 734 int err;
@@ -749,9 +748,6 @@ int snd_es1688_pcm(struct snd_card *card, struct snd_es1688 *chip,
749 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 748 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
750 snd_dma_isa_data(), 749 snd_dma_isa_data(),
751 64*1024, 64*1024); 750 64*1024, 64*1024);
752
753 if (rpcm)
754 *rpcm = pcm;
755 return 0; 751 return 0;
756} 752}
757 753
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 28a16936a397..acc655284a9c 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -284,7 +284,7 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
284 } 284 }
285 gus->codec_flag = 1; 285 gus->codec_flag = 1;
286 286
287 error = snd_es1688_pcm(card, es1688, 0, NULL); 287 error = snd_es1688_pcm(card, es1688, 0);
288 if (error < 0) 288 if (error < 0)
289 goto out; 289 goto out;
290 290