Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lars-Peter Clausen and committed by
Takashi Iwai
1b16416f 0f33991d

+9 -24
+3 -3
sound/pci/trident/trident.c
··· 127 127 sprintf(card->longname, "%s PCI Audio at 0x%lx, irq %d", 128 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 131 snd_card_free(card); 132 132 return err; 133 133 } 134 134 switch (trident->device) { 135 135 case TRIDENT_DEVICE_ID_DX: 136 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 138 snd_card_free(card); 139 139 return err; 140 140 } 141 141 break; 142 142 } 143 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 145 snd_card_free(card); 146 146 return err; 147 147 }
+3 -3
sound/pci/trident/trident.h
··· 420 420 struct snd_trident ** rtrident); 421 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); 424 - int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 425 - int snd_trident_spdif_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); 425 + int snd_trident_spdif_pcm(struct snd_trident *trident, int device); 426 426 int snd_trident_attach_synthesizer(struct snd_trident * trident); 427 427 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, 428 428 int client, int port);
+3 -18
sound/pci/trident/trident_main.c
··· 2172 2172 2173 2173 ---------------------------------------------------------------------------*/ 2174 2174 2175 - int snd_trident_pcm(struct snd_trident *trident, 2176 - int device, struct snd_pcm **rpcm) 2175 + int snd_trident_pcm(struct snd_trident *trident, int device) 2177 2176 { 2178 2177 struct snd_pcm *pcm; 2179 2178 int err; 2180 2179 2181 - if (rpcm) 2182 - *rpcm = NULL; 2183 2180 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, trident->ChanPCM, 1, &pcm)) < 0) 2184 2181 return err; 2185 2182 ··· 2211 2214 snd_dma_pci_data(trident->pci), 64*1024, 128*1024); 2212 2215 } 2213 2216 2214 - if (rpcm) 2215 - *rpcm = pcm; 2216 2217 return 0; 2217 2218 } 2218 2219 ··· 2225 2230 2226 2231 ---------------------------------------------------------------------------*/ 2227 2232 2228 - int snd_trident_foldback_pcm(struct snd_trident *trident, 2229 - int device, struct snd_pcm **rpcm) 2233 + int snd_trident_foldback_pcm(struct snd_trident *trident, int device) 2230 2234 { 2231 2235 struct snd_pcm *foldback; 2232 2236 int err; 2233 2237 int num_chan = 3; 2234 2238 struct snd_pcm_substream *substream; 2235 2239 2236 - if (rpcm) 2237 - *rpcm = NULL; 2238 2240 if (trident->device == TRIDENT_DEVICE_ID_NX) 2239 2241 num_chan = 4; 2240 2242 if ((err = snd_pcm_new(trident->card, "trident_dx_nx", device, 0, num_chan, &foldback)) < 0) ··· 2263 2271 snd_pcm_lib_preallocate_pages_for_all(foldback, SNDRV_DMA_TYPE_DEV, 2264 2272 snd_dma_pci_data(trident->pci), 64*1024, 128*1024); 2265 2273 2266 - if (rpcm) 2267 - *rpcm = foldback; 2268 2274 return 0; 2269 2275 } 2270 2276 ··· 2277 2287 2278 2288 ---------------------------------------------------------------------------*/ 2279 2289 2280 - int snd_trident_spdif_pcm(struct snd_trident *trident, 2281 - int device, struct snd_pcm **rpcm) 2290 + int snd_trident_spdif_pcm(struct snd_trident *trident, int device) 2282 2291 { 2283 2292 struct snd_pcm *spdif; 2284 2293 int err; 2285 2294 2286 - if (rpcm) 2287 - *rpcm = NULL; 2288 2295 if ((err = snd_pcm_new(trident->card, "trident_dx_nx IEC958", device, 1, 0, &spdif)) < 0) 2289 2296 return err; 2290 2297 ··· 2297 2310 2298 2311 snd_pcm_lib_preallocate_pages_for_all(spdif, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(trident->pci), 64*1024, 128*1024); 2299 2312 2300 - if (rpcm) 2301 - *rpcm = spdif; 2302 2313 return 0; 2303 2314 } 2304 2315