diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-02 06:24:54 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-02 10:34:06 -0500 |
commit | 1b16416fda21a8c5704bce809e0d7387bbfb097d (patch) | |
tree | e63e0ef7a43624b8bd056ac066c710b289199891 | |
parent | 0f33991dd2811cb5458b1a2bc19c6aa6ff64c00b (diff) |
ALSA: trident: Remove always NULL parameters
The various PCM allocation functions in this driver take a pointer to a
pointer of a PCM where if this parameter is provided the newly allocated PCM
is stored. All callers pass NULL though, so remove the parameter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/trident/trident.c | 6 | ||||
-rw-r--r-- | sound/pci/trident/trident.h | 6 | ||||
-rw-r--r-- | sound/pci/trident/trident_main.c | 21 |
3 files changed, 9 insertions, 24 deletions
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c index a54cd6879b31..cedf13b64803 100644 --- a/sound/pci/trident/trident.c +++ b/sound/pci/trident/trident.c | |||
@@ -127,21 +127,21 @@ static int snd_trident_probe(struct pci_dev *pci, | |||
127 | sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", | 127 | sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", |
128 | card->shortname, trident->port, trident->irq); | 128 | card->shortname, trident->port, trident->irq); |
129 | 129 | ||
130 | if ((err = snd_trident_pcm(trident, pcm_dev++, NULL)) < 0) { | 130 | if ((err = snd_trident_pcm(trident, pcm_dev++)) < 0) { |
131 | snd_card_free(card); | 131 | snd_card_free(card); |
132 | return err; | 132 | return err; |
133 | } | 133 | } |
134 | switch (trident->device) { | 134 | switch (trident->device) { |
135 | case TRIDENT_DEVICE_ID_DX: | 135 | case TRIDENT_DEVICE_ID_DX: |
136 | case TRIDENT_DEVICE_ID_NX: | 136 | case TRIDENT_DEVICE_ID_NX: |
137 | if ((err = snd_trident_foldback_pcm(trident, pcm_dev++, NULL)) < 0) { | 137 | if ((err = snd_trident_foldback_pcm(trident, pcm_dev++)) < 0) { |
138 | snd_card_free(card); | 138 | snd_card_free(card); |
139 | return err; | 139 | return err; |
140 | } | 140 | } |
141 | break; | 141 | break; |
142 | } | 142 | } |
143 | if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { | 143 | if (trident->device == TRIDENT_DEVICE_ID_NX || trident->device == TRIDENT_DEVICE_ID_SI7018) { |
144 | if ((err = snd_trident_spdif_pcm(trident, pcm_dev++, NULL)) < 0) { | 144 | if ((err = snd_trident_spdif_pcm(trident, pcm_dev++)) < 0) { |
145 | snd_card_free(card); | 145 | snd_card_free(card); |
146 | return err; | 146 | return err; |
147 | } | 147 | } |
diff --git a/sound/pci/trident/trident.h b/sound/pci/trident/trident.h index 5f110eb56e47..9624e5937719 100644 --- a/sound/pci/trident/trident.h +++ b/sound/pci/trident/trident.h | |||
@@ -420,9 +420,9 @@ int snd_trident_create(struct snd_card *card, | |||
420 | struct snd_trident ** rtrident); | 420 | struct snd_trident ** rtrident); |
421 | int snd_trident_create_gameport(struct snd_trident *trident); | 421 | int snd_trident_create_gameport(struct snd_trident *trident); |
422 | 422 | ||
423 | int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | 423 | int snd_trident_pcm(struct snd_trident *trident, int device); |
424 | int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | 424 | int snd_trident_foldback_pcm(struct snd_trident *trident, int device); |
425 | int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | 425 | int snd_trident_spdif_pcm(struct snd_trident *trident, int device); |
426 | int snd_trident_attach_synthesizer(struct snd_trident * trident); | 426 | int snd_trident_attach_synthesizer(struct snd_trident * trident); |
427 | struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, | 427 | struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, |
428 | int client, int port); | 428 | int client, int port); |
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 57cd757acfe7..c380c99407c0 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c | |||
@@ -2172,14 +2172,11 @@ static struct snd_pcm_ops snd_trident_spdif_7018_ops = { | |||
2172 | 2172 | ||
2173 | ---------------------------------------------------------------------------*/ | 2173 | ---------------------------------------------------------------------------*/ |
2174 | 2174 | ||
2175 | int snd_trident_pcm(struct snd_trident *trident, | 2175 | int snd_trident_pcm(struct snd_trident *trident, int device) |
2176 | int device, struct snd_pcm **rpcm) | ||
2177 | { | 2176 | { |
2178 | struct snd_pcm *pcm; | 2177 | struct snd_pcm *pcm; |
2179 | int err; | 2178 | int err; |
2180 | 2179 | ||
2181 | if (rpcm) | ||
2182 | *rpcm = NULL; | ||
2183 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm)) < 0) | 2180 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm)) < 0) |
2184 | return err; | 2181 | return err; |
2185 | 2182 | ||
@@ -2214,8 +2211,6 @@ int snd_trident_pcm(struct snd_trident *trident, | |||
2214 | snd_dma_pci_data(trident->pci), 64*1024, 128*1024); | 2211 | snd_dma_pci_data(trident->pci), 64*1024, 128*1024); |
2215 | } | 2212 | } |
2216 | 2213 | ||
2217 | if (rpcm) | ||
2218 | *rpcm = pcm; | ||
2219 | return 0; | 2214 | return 0; |
2220 | } | 2215 | } |
2221 | 2216 | ||
@@ -2230,16 +2225,13 @@ int snd_trident_pcm(struct snd_trident *trident, | |||
2230 | 2225 | ||
2231 | ---------------------------------------------------------------------------*/ | 2226 | ---------------------------------------------------------------------------*/ |
2232 | 2227 | ||
2233 | int snd_trident_foldback_pcm(struct snd_trident *trident, | 2228 | int snd_trident_foldback_pcm(struct snd_trident *trident, int device) |
2234 | int device, struct snd_pcm **rpcm) | ||
2235 | { | 2229 | { |
2236 | struct snd_pcm *foldback; | 2230 | struct snd_pcm *foldback; |
2237 | int err; | 2231 | int err; |
2238 | int num_chan = 3; | 2232 | int num_chan = 3; |
2239 | struct snd_pcm_substream *substream; | 2233 | struct snd_pcm_substream *substream; |
2240 | 2234 | ||
2241 | if (rpcm) | ||
2242 | *rpcm = NULL; | ||
2243 | if (trident->device == TRIDENT_DEVICE_ID_NX) | 2235 | if (trident->device == TRIDENT_DEVICE_ID_NX) |
2244 | num_chan = 4; | 2236 | num_chan = 4; |
2245 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback)) < 0) | 2237 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback)) < 0) |
@@ -2271,8 +2263,6 @@ int snd_trident_foldback_pcm(struct snd_trident *trident, | |||
2271 | snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_DEV, | 2263 | snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_DEV, |
2272 | snd_dma_pci_data(trident->pci), 64*1024, 128*1024); | 2264 | snd_dma_pci_data(trident->pci), 64*1024, 128*1024); |
2273 | 2265 | ||
2274 | if (rpcm) | ||
2275 | *rpcm = foldback; | ||
2276 | return 0; | 2266 | return 0; |
2277 | } | 2267 | } |
2278 | 2268 | ||
@@ -2287,14 +2277,11 @@ int snd_trident_foldback_pcm(struct snd_trident *trident, | |||
2287 | 2277 | ||
2288 | ---------------------------------------------------------------------------*/ | 2278 | ---------------------------------------------------------------------------*/ |
2289 | 2279 | ||
2290 | int snd_trident_spdif_pcm(struct snd_trident *trident, | 2280 | int snd_trident_spdif_pcm(struct snd_trident *trident, int device) |
2291 | int device, struct snd_pcm **rpcm) | ||
2292 | { | 2281 | { |
2293 | struct snd_pcm *spdif; | 2282 | struct snd_pcm *spdif; |
2294 | int err; | 2283 | int err; |
2295 | 2284 | ||
2296 | if (rpcm) | ||
2297 | *rpcm = NULL; | ||
2298 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif)) < 0) | 2285 | if ((err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif)) < 0) |
2299 | return err; | 2286 | return err; |
2300 | 2287 | ||
@@ -2310,8 +2297,6 @@ int snd_trident_spdif_pcm(struct snd_trident *trident, | |||
2310 | 2297 | ||
2311 | snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), 64*1024, 128*1024); | 2298 | snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), 64*1024, 128*1024); |
2312 | 2299 | ||
2313 | if (rpcm) | ||
2314 | *rpcm = spdif; | ||
2315 | return 0; | 2300 | return 0; |
2316 | } | 2301 | } |
2317 | 2302 | ||