diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-02 06:24:36 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-02 10:26:20 -0500 |
commit | 7f605418837add961466dc66f7370332d44c1a92 (patch) | |
tree | f12dd6b0429e92d38c477b151ca47867379665e1 | |
parent | e9dd86267f2571a9649399c9e268266ca5aa6152 (diff) |
ALSA: ad1816a: Remove always NULL parameters
snd_ad1816a_pcm() and snd_ad1816a_timer() take a pointer to a pointer of a
PCM/timer where if this parameter is provided the newly allocated object 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-- | include/sound/ad1816a.h | 5 | ||||
-rw-r--r-- | sound/isa/ad1816a/ad1816a.c | 5 | ||||
-rw-r--r-- | sound/isa/ad1816a/ad1816a_lib.c | 9 |
3 files changed, 6 insertions, 13 deletions
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h index abdf609c5918..f2d3a6d07210 100644 --- a/include/sound/ad1816a.h +++ b/include/sound/ad1816a.h | |||
@@ -170,10 +170,9 @@ extern int snd_ad1816a_create(struct snd_card *card, unsigned long port, | |||
170 | int irq, int dma1, int dma2, | 170 | int irq, int dma1, int dma2, |
171 | struct snd_ad1816a *chip); | 171 | struct snd_ad1816a *chip); |
172 | 172 | ||
173 | extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm); | 173 | extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device); |
174 | extern int snd_ad1816a_mixer(struct snd_ad1816a *chip); | 174 | extern int snd_ad1816a_mixer(struct snd_ad1816a *chip); |
175 | extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, | 175 | extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device); |
176 | struct snd_timer **rtimer); | ||
177 | #ifdef CONFIG_PM | 176 | #ifdef CONFIG_PM |
178 | extern void snd_ad1816a_suspend(struct snd_ad1816a *chip); | 177 | extern void snd_ad1816a_suspend(struct snd_ad1816a *chip); |
179 | extern void snd_ad1816a_resume(struct snd_ad1816a *chip); | 178 | extern void snd_ad1816a_resume(struct snd_ad1816a *chip); |
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c index f481a41e027e..769226515f0d 100644 --- a/sound/isa/ad1816a/ad1816a.c +++ b/sound/isa/ad1816a/ad1816a.c | |||
@@ -142,7 +142,6 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard, | |||
142 | struct snd_card *card; | 142 | struct snd_card *card; |
143 | struct snd_ad1816a *chip; | 143 | struct snd_ad1816a *chip; |
144 | struct snd_opl3 *opl3; | 144 | struct snd_opl3 *opl3; |
145 | struct snd_timer *timer; | ||
146 | 145 | ||
147 | error = snd_card_new(&pcard->card->dev, | 146 | error = snd_card_new(&pcard->card->dev, |
148 | index[dev], id[dev], THIS_MODULE, | 147 | index[dev], id[dev], THIS_MODULE, |
@@ -172,7 +171,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard, | |||
172 | sprintf(card->longname, "%s, SS at 0x%lx, irq %d, dma %d&%d", | 171 | sprintf(card->longname, "%s, SS at 0x%lx, irq %d, dma %d&%d", |
173 | card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]); | 172 | card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]); |
174 | 173 | ||
175 | if ((error = snd_ad1816a_pcm(chip, 0, NULL)) < 0) { | 174 | if ((error = snd_ad1816a_pcm(chip, 0)) < 0) { |
176 | snd_card_free(card); | 175 | snd_card_free(card); |
177 | return error; | 176 | return error; |
178 | } | 177 | } |
@@ -182,7 +181,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard, | |||
182 | return error; | 181 | return error; |
183 | } | 182 | } |
184 | 183 | ||
185 | error = snd_ad1816a_timer(chip, 0, &timer); | 184 | error = snd_ad1816a_timer(chip, 0); |
186 | if (error < 0) { | 185 | if (error < 0) { |
187 | snd_card_free(card); | 186 | snd_card_free(card); |
188 | return error; | 187 | return error; |
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c index 01a07986f4a3..5f99102cc0c1 100644 --- a/sound/isa/ad1816a/ad1816a_lib.c +++ b/sound/isa/ad1816a/ad1816a_lib.c | |||
@@ -675,7 +675,7 @@ static struct snd_pcm_ops snd_ad1816a_capture_ops = { | |||
675 | .pointer = snd_ad1816a_capture_pointer, | 675 | .pointer = snd_ad1816a_capture_pointer, |
676 | }; | 676 | }; |
677 | 677 | ||
678 | int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm) | 678 | int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device) |
679 | { | 679 | { |
680 | int error; | 680 | int error; |
681 | struct snd_pcm *pcm; | 681 | struct snd_pcm *pcm; |
@@ -697,13 +697,10 @@ int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm) | |||
697 | 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); | 697 | 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); |
698 | 698 | ||
699 | chip->pcm = pcm; | 699 | chip->pcm = pcm; |
700 | if (rpcm) | ||
701 | *rpcm = pcm; | ||
702 | return 0; | 700 | return 0; |
703 | } | 701 | } |
704 | 702 | ||
705 | int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, | 703 | int snd_ad1816a_timer(struct snd_ad1816a *chip, int device) |
706 | struct snd_timer **rtimer) | ||
707 | { | 704 | { |
708 | struct snd_timer *timer; | 705 | struct snd_timer *timer; |
709 | struct snd_timer_id tid; | 706 | struct snd_timer_id tid; |
@@ -720,8 +717,6 @@ int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, | |||
720 | timer->private_data = chip; | 717 | timer->private_data = chip; |
721 | chip->timer = timer; | 718 | chip->timer = timer; |
722 | timer->hw = snd_ad1816a_timer_table; | 719 | timer->hw = snd_ad1816a_timer_table; |
723 | if (rtimer) | ||
724 | *rtimer = timer; | ||
725 | return 0; | 720 | return 0; |
726 | } | 721 | } |
727 | 722 | ||