All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	alsa-devel@alsa-project.org,
	Eliot Blennerhassett <eliot@blennerhassett.gen.nz>
Subject: [PATCH 02/21] ALSA: ad1816a: Remove always NULL parameters
Date: Fri,  2 Jan 2015 12:24:36 +0100	[thread overview]
Message-ID: <1420197895-17696-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1420197895-17696-1-git-send-email-lars@metafoo.de>

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>
---
 include/sound/ad1816a.h         | 5 ++---
 sound/isa/ad1816a/ad1816a.c     | 5 ++---
 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 abdf609..f2d3a6d 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,
 			      int irq, int dma1, int dma2,
 			      struct snd_ad1816a *chip);
 
-extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm);
+extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device);
 extern int snd_ad1816a_mixer(struct snd_ad1816a *chip);
-extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device,
-			     struct snd_timer **rtimer);
+extern int snd_ad1816a_timer(struct snd_ad1816a *chip, int device);
 #ifdef CONFIG_PM
 extern void snd_ad1816a_suspend(struct snd_ad1816a *chip);
 extern void snd_ad1816a_resume(struct snd_ad1816a *chip);
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index f481a41..7692265 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,
 	struct snd_card *card;
 	struct snd_ad1816a *chip;
 	struct snd_opl3 *opl3;
-	struct snd_timer *timer;
 
 	error = snd_card_new(&pcard->card->dev,
 			     index[dev], id[dev], THIS_MODULE,
@@ -172,7 +171,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
 	sprintf(card->longname, "%s, SS at 0x%lx, irq %d, dma %d&%d",
 		card->shortname, chip->port, irq[dev], dma1[dev], dma2[dev]);
 
-	if ((error = snd_ad1816a_pcm(chip, 0, NULL)) < 0) {
+	if ((error = snd_ad1816a_pcm(chip, 0)) < 0) {
 		snd_card_free(card);
 		return error;
 	}
@@ -182,7 +181,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
 		return error;
 	}
 
-	error = snd_ad1816a_timer(chip, 0, &timer);
+	error = snd_ad1816a_timer(chip, 0);
 	if (error < 0) {
 		snd_card_free(card);
 		return error;
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index 01a0798..5f99102 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 = {
 	.pointer =	snd_ad1816a_capture_pointer,
 };
 
-int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm)
+int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device)
 {
 	int error;
 	struct snd_pcm *pcm;
@@ -697,13 +697,10 @@ int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm)
 					      64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024);
 
 	chip->pcm = pcm;
-	if (rpcm)
-		*rpcm = pcm;
 	return 0;
 }
 
-int snd_ad1816a_timer(struct snd_ad1816a *chip, int device,
-		      struct snd_timer **rtimer)
+int snd_ad1816a_timer(struct snd_ad1816a *chip, int device)
 {
 	struct snd_timer *timer;
 	struct snd_timer_id tid;
@@ -720,8 +717,6 @@ int snd_ad1816a_timer(struct snd_ad1816a *chip, int device,
 	timer->private_data = chip;
 	chip->timer = timer;
 	timer->hw = snd_ad1816a_timer_table;
-	if (rtimer)
-		*rtimer = timer;
 	return 0;
 }
 
-- 
1.8.0

  parent reply	other threads:[~2015-01-02 11:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-02 11:24 [PATCH 00/21] ALSA: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 01/21] ALSA: ml403-ac97cr: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` Lars-Peter Clausen [this message]
2015-01-02 11:24 ` [PATCH 03/21] ALSA: es1688: Remove almost " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 04/21] ALSA: es18xx: Remove " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 05/21] ALSA: gus: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 06/21] ALSA: msnd: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 07/21] ALSA: sb8: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 08/21] ASoC: sb16: Simplify snd_sb16dsp_pcm() Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 09/21] ALSA: wss: Remove (almost) always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 10/21] ASLA: ad1889: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 11/21] ALSA: asihpi: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 12/21] ALSA: cs4281: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 13/21] ALSA: cs46xx: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 14/21] ALSA: ens1370: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 15/21] ALSA: emu10k1: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 16/21] ALSA: fm801: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 17/21] ALSA: ice1712: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 18/21] ALSA: riptide: Remove always NULL parameter Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 19/21] ALSA: sonicvibes: " Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 20/21] ALSA: trident: Remove always NULL parameters Lars-Peter Clausen
2015-01-02 11:24 ` [PATCH 21/21] ALSA: ymfpci: " Lars-Peter Clausen
2015-01-02 15:35 ` [PATCH 00/21] ALSA: " Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420197895-17696-3-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=eliot@blennerhassett.gen.nz \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.