Commit 08a4c10b authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Takashi Iwai

ALSA: ice1712: 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. This makes
the code a bit cleaner and shorter.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 483337f9
...@@ -880,13 +880,11 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = { ...@@ -880,13 +880,11 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = {
.pointer = snd_ice1712_capture_pointer, .pointer = snd_ice1712_capture_pointer,
}; };
static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm)
*rpcm = NULL;
err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm); err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm);
if (err < 0) if (err < 0)
return err; return err;
...@@ -902,22 +900,17 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm * ...@@ -902,22 +900,17 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm *
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(ice->pci), 64*1024, 64*1024); snd_dma_pci_data(ice->pci), 64*1024, 64*1024);
if (rpcm)
*rpcm = pcm;
dev_warn(ice->card->dev, dev_warn(ice->card->dev,
"Consumer PCM code does not work well at the moment --jk\n"); "Consumer PCM code does not work well at the moment --jk\n");
return 0; return 0;
} }
static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm)
*rpcm = NULL;
err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm); err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm);
if (err < 0) if (err < 0)
return err; return err;
...@@ -932,9 +925,6 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pc ...@@ -932,9 +925,6 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pc
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(ice->pci), 64*1024, 128*1024); snd_dma_pci_data(ice->pci), 64*1024, 128*1024);
if (rpcm)
*rpcm = pcm;
return 0; return 0;
} }
...@@ -1260,13 +1250,11 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = { ...@@ -1260,13 +1250,11 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = {
.pointer = snd_ice1712_capture_pro_pointer, .pointer = snd_ice1712_capture_pro_pointer,
}; };
static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device)
{ {
struct snd_pcm *pcm; struct snd_pcm *pcm;
int err; int err;
if (rpcm)
*rpcm = NULL;
err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm); err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1282,8 +1270,6 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd ...@@ -1282,8 +1270,6 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd
snd_dma_pci_data(ice->pci), 256*1024, 256*1024); snd_dma_pci_data(ice->pci), 256*1024, 256*1024);
ice->pcm_pro = pcm; ice->pcm_pro = pcm;
if (rpcm)
*rpcm = pcm;
if (ice->cs8427) { if (ice->cs8427) {
/* assign channels to iec958 */ /* assign channels to iec958 */
...@@ -2691,14 +2677,14 @@ static int snd_ice1712_probe(struct pci_dev *pci, ...@@ -2691,14 +2677,14 @@ static int snd_ice1712_probe(struct pci_dev *pci,
c = &no_matched; c = &no_matched;
__found: __found:
err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL); err = snd_ice1712_pcm_profi(ice, pcm_dev++);
if (err < 0) { if (err < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
if (ice_has_con_ac97(ice)) { if (ice_has_con_ac97(ice)) {
err = snd_ice1712_pcm(ice, pcm_dev++, NULL); err = snd_ice1712_pcm(ice, pcm_dev++);
if (err < 0) { if (err < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
...@@ -2726,7 +2712,7 @@ static int snd_ice1712_probe(struct pci_dev *pci, ...@@ -2726,7 +2712,7 @@ static int snd_ice1712_probe(struct pci_dev *pci,
} }
if (ice_has_con_ac97(ice)) { if (ice_has_con_ac97(ice)) {
err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL); err = snd_ice1712_pcm_ds(ice, pcm_dev++);
if (err < 0) { if (err < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment