ALSA: pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
authorDominik Brodowski <linux@dominikbrodowski.net>
Sat, 24 Oct 2009 19:43:03 +0000 (21:43 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 2 Nov 2009 10:41:41 +0000 (11:41 +0100)
Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.

Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pcmcia/pdaudiocf/pdaudiocf.c
sound/pcmcia/vx/vxpocket.c

index 7dea74b..64b8599 100644 (file)
@@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link)
  * configuration callback
  */
 
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
 static int pdacf_config(struct pcmcia_device *link)
 {
        struct snd_pdacf *pdacf = link->priv;
-       int last_fn, last_ret;
+       int ret;
 
        snd_printdd(KERN_DEBUG "pdacf_config called\n");
        link->conf.ConfigIndex = 0x5;
 
-       CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
-       CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
-       CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+       ret = pcmcia_request_io(link, &link->io);
+       if (ret)
+               goto failed;
+
+       ret = pcmcia_request_irq(link, &link->irq);
+       if (ret)
+               goto failed;
+
+       ret = pcmcia_request_configuration(link, &link->conf);
+       if (ret)
+               goto failed;
 
        if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
                goto failed;
@@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link)
        link->dev_node = &pdacf->node;
        return 0;
 
-cs_failed:
-       cs_error(link, last_fn, last_ret);
 failed:
        pcmcia_disable_device(link);
        return -ENODEV;
index 7445cc8..1492744 100644 (file)
@@ -213,14 +213,11 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq
  * configuration callback
  */
 
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
-
 static int vxpocket_config(struct pcmcia_device *link)
 {
        struct vx_core *chip = link->priv;
        struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
-       int last_fn, last_ret;
+       int ret;
 
        snd_printdd(KERN_DEBUG "vxpocket_config called\n");
 
@@ -235,9 +232,17 @@ static int vxpocket_config(struct pcmcia_device *link)
                strcpy(chip->card->driver, vxp440_hw.name);
        }
 
-       CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
-       CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
-       CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+       ret = pcmcia_request_io(link, &link->io);
+       if (ret)
+               goto failed;
+
+       ret = pcmcia_request_irq(link, &link->irq);
+       if (ret)
+               goto failed;
+
+       ret = pcmcia_request_configuration(link, &link->conf);
+       if (ret)
+               goto failed;
 
        chip->dev = &handle_to_dev(link);
        snd_card_set_dev(chip->card, chip->dev);
@@ -248,8 +253,6 @@ static int vxpocket_config(struct pcmcia_device *link)
        link->dev_node = &vxp->node;
        return 0;
 
-cs_failed:
-       cs_error(link, last_fn, last_ret);
 failed:
        pcmcia_disable_device(link);
        return -ENODEV;