ALSA: ad1816a: Remove always NULL parameters
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 2 Jan 2015 11:24:36 +0000 (12:24 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Jan 2015 15:26:20 +0000 (16:26 +0100)
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>
include/sound/ad1816a.h
sound/isa/ad1816a/ad1816a.c
sound/isa/ad1816a/ad1816a_lib.c

index abdf609c5918ab0d1baf94ee4158a3c9ada1622b..f2d3a6d0721016589c5e52b0066dbdb3df012366 100644 (file)
@@ -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);
index f481a41e027eb132a2acfd1632f8351fe4daa8b6..769226515f0d6d43fa3f05f73c2db11c0385ba14 100644 (file)
@@ -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;
index 01a07986f4a3dcffb89aa8b7d00338616f73c864..5f99102cc0c1cfcbd274f0419e534ecd60a7171d 100644 (file)
@@ -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;
 }
 
This page took 0.026545 seconds and 5 git commands to generate.