diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-02 06:24:51 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-02 10:33:20 -0500 |
commit | 08a4c10b58d6403ca9fe8c872e22ecad47924fec (patch) | |
tree | b5b821681d3da6c1084bd93f45cc989417d77d71 | |
parent | 483337f903dd39a10d4d6617cf6f30feeead061c (diff) |
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index b039b46152c6..a2ee29826d0d 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c | |||
@@ -880,13 +880,11 @@ static struct snd_pcm_ops snd_ice1712_capture_ops = { | |||
880 | .pointer = snd_ice1712_capture_pointer, | 880 | .pointer = snd_ice1712_capture_pointer, |
881 | }; | 881 | }; |
882 | 882 | ||
883 | static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 883 | static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device) |
884 | { | 884 | { |
885 | struct snd_pcm *pcm; | 885 | struct snd_pcm *pcm; |
886 | int err; | 886 | int err; |
887 | 887 | ||
888 | if (rpcm) | ||
889 | *rpcm = NULL; | ||
890 | err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm); | 888 | err = snd_pcm_new(ice->card, "ICE1712 consumer", device, 1, 1, &pcm); |
891 | if (err < 0) | 889 | if (err < 0) |
892 | return err; | 890 | return err; |
@@ -902,22 +900,17 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device, struct snd_pcm * | |||
902 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 900 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
903 | snd_dma_pci_data(ice->pci), 64*1024, 64*1024); | 901 | snd_dma_pci_data(ice->pci), 64*1024, 64*1024); |
904 | 902 | ||
905 | if (rpcm) | ||
906 | *rpcm = pcm; | ||
907 | |||
908 | dev_warn(ice->card->dev, | 903 | dev_warn(ice->card->dev, |
909 | "Consumer PCM code does not work well at the moment --jk\n"); | 904 | "Consumer PCM code does not work well at the moment --jk\n"); |
910 | 905 | ||
911 | return 0; | 906 | return 0; |
912 | } | 907 | } |
913 | 908 | ||
914 | static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 909 | static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device) |
915 | { | 910 | { |
916 | struct snd_pcm *pcm; | 911 | struct snd_pcm *pcm; |
917 | int err; | 912 | int err; |
918 | 913 | ||
919 | if (rpcm) | ||
920 | *rpcm = NULL; | ||
921 | err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm); | 914 | err = snd_pcm_new(ice->card, "ICE1712 consumer (DS)", device, 6, 0, &pcm); |
922 | if (err < 0) | 915 | if (err < 0) |
923 | return err; | 916 | return err; |
@@ -932,9 +925,6 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device, struct snd_pc | |||
932 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | 925 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
933 | snd_dma_pci_data(ice->pci), 64*1024, 128*1024); | 926 | snd_dma_pci_data(ice->pci), 64*1024, 128*1024); |
934 | 927 | ||
935 | if (rpcm) | ||
936 | *rpcm = pcm; | ||
937 | |||
938 | return 0; | 928 | return 0; |
939 | } | 929 | } |
940 | 930 | ||
@@ -1260,13 +1250,11 @@ static struct snd_pcm_ops snd_ice1712_capture_pro_ops = { | |||
1260 | .pointer = snd_ice1712_capture_pro_pointer, | 1250 | .pointer = snd_ice1712_capture_pro_pointer, |
1261 | }; | 1251 | }; |
1262 | 1252 | ||
1263 | static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd_pcm **rpcm) | 1253 | static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device) |
1264 | { | 1254 | { |
1265 | struct snd_pcm *pcm; | 1255 | struct snd_pcm *pcm; |
1266 | int err; | 1256 | int err; |
1267 | 1257 | ||
1268 | if (rpcm) | ||
1269 | *rpcm = NULL; | ||
1270 | err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm); | 1258 | err = snd_pcm_new(ice->card, "ICE1712 multi", device, 1, 1, &pcm); |
1271 | if (err < 0) | 1259 | if (err < 0) |
1272 | return err; | 1260 | return err; |
@@ -1282,8 +1270,6 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device, struct snd | |||
1282 | snd_dma_pci_data(ice->pci), 256*1024, 256*1024); | 1270 | snd_dma_pci_data(ice->pci), 256*1024, 256*1024); |
1283 | 1271 | ||
1284 | ice->pcm_pro = pcm; | 1272 | ice->pcm_pro = pcm; |
1285 | if (rpcm) | ||
1286 | *rpcm = pcm; | ||
1287 | 1273 | ||
1288 | if (ice->cs8427) { | 1274 | if (ice->cs8427) { |
1289 | /* assign channels to iec958 */ | 1275 | /* assign channels to iec958 */ |
@@ -2691,14 +2677,14 @@ static int snd_ice1712_probe(struct pci_dev *pci, | |||
2691 | c = &no_matched; | 2677 | c = &no_matched; |
2692 | __found: | 2678 | __found: |
2693 | 2679 | ||
2694 | err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL); | 2680 | err = snd_ice1712_pcm_profi(ice, pcm_dev++); |
2695 | if (err < 0) { | 2681 | if (err < 0) { |
2696 | snd_card_free(card); | 2682 | snd_card_free(card); |
2697 | return err; | 2683 | return err; |
2698 | } | 2684 | } |
2699 | 2685 | ||
2700 | if (ice_has_con_ac97(ice)) { | 2686 | if (ice_has_con_ac97(ice)) { |
2701 | err = snd_ice1712_pcm(ice, pcm_dev++, NULL); | 2687 | err = snd_ice1712_pcm(ice, pcm_dev++); |
2702 | if (err < 0) { | 2688 | if (err < 0) { |
2703 | snd_card_free(card); | 2689 | snd_card_free(card); |
2704 | return err; | 2690 | return err; |
@@ -2726,7 +2712,7 @@ static int snd_ice1712_probe(struct pci_dev *pci, | |||
2726 | } | 2712 | } |
2727 | 2713 | ||
2728 | if (ice_has_con_ac97(ice)) { | 2714 | if (ice_has_con_ac97(ice)) { |
2729 | err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL); | 2715 | err = snd_ice1712_pcm_ds(ice, pcm_dev++); |
2730 | if (err < 0) { | 2716 | if (err < 0) { |
2731 | snd_card_free(card); | 2717 | snd_card_free(card); |
2732 | return err; | 2718 | return err; |