diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-24 15:43:03 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-02 05:41:41 -0500 |
commit | 0d488234fd857aae07f1c56467bbf58f1a859753 (patch) | |
tree | 9be5d48bc57b817f1e9ffa63b5d694ddb9a5b190 /sound | |
parent | 3d00941371a765779c4e3509214c7e5793cce1fe (diff) |
ALSA: pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound)
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 21 | ||||
-rw-r--r-- | sound/pcmcia/vx/vxpocket.c | 21 |
2 files changed, 24 insertions, 18 deletions
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 7dea74b71cf1..64b859925c0b 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c | |||
@@ -217,20 +217,25 @@ static void snd_pdacf_detach(struct pcmcia_device *link) | |||
217 | * configuration callback | 217 | * configuration callback |
218 | */ | 218 | */ |
219 | 219 | ||
220 | #define CS_CHECK(fn, ret) \ | ||
221 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
222 | |||
223 | static int pdacf_config(struct pcmcia_device *link) | 220 | static int pdacf_config(struct pcmcia_device *link) |
224 | { | 221 | { |
225 | struct snd_pdacf *pdacf = link->priv; | 222 | struct snd_pdacf *pdacf = link->priv; |
226 | int last_fn, last_ret; | 223 | int ret; |
227 | 224 | ||
228 | snd_printdd(KERN_DEBUG "pdacf_config called\n"); | 225 | snd_printdd(KERN_DEBUG "pdacf_config called\n"); |
229 | link->conf.ConfigIndex = 0x5; | 226 | link->conf.ConfigIndex = 0x5; |
230 | 227 | ||
231 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 228 | ret = pcmcia_request_io(link, &link->io); |
232 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 229 | if (ret) |
233 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 230 | goto failed; |
231 | |||
232 | ret = pcmcia_request_irq(link, &link->irq); | ||
233 | if (ret) | ||
234 | goto failed; | ||
235 | |||
236 | ret = pcmcia_request_configuration(link, &link->conf); | ||
237 | if (ret) | ||
238 | goto failed; | ||
234 | 239 | ||
235 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) | 240 | if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq.AssignedIRQ) < 0) |
236 | goto failed; | 241 | goto failed; |
@@ -238,8 +243,6 @@ static int pdacf_config(struct pcmcia_device *link) | |||
238 | link->dev_node = &pdacf->node; | 243 | link->dev_node = &pdacf->node; |
239 | return 0; | 244 | return 0; |
240 | 245 | ||
241 | cs_failed: | ||
242 | cs_error(link, last_fn, last_ret); | ||
243 | failed: | 246 | failed: |
244 | pcmcia_disable_device(link); | 247 | pcmcia_disable_device(link); |
245 | return -ENODEV; | 248 | return -ENODEV; |
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 7445cc8a47d3..1492744ad67f 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c | |||
@@ -213,14 +213,11 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq | |||
213 | * configuration callback | 213 | * configuration callback |
214 | */ | 214 | */ |
215 | 215 | ||
216 | #define CS_CHECK(fn, ret) \ | ||
217 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
218 | |||
219 | static int vxpocket_config(struct pcmcia_device *link) | 216 | static int vxpocket_config(struct pcmcia_device *link) |
220 | { | 217 | { |
221 | struct vx_core *chip = link->priv; | 218 | struct vx_core *chip = link->priv; |
222 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; | 219 | struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; |
223 | int last_fn, last_ret; | 220 | int ret; |
224 | 221 | ||
225 | snd_printdd(KERN_DEBUG "vxpocket_config called\n"); | 222 | snd_printdd(KERN_DEBUG "vxpocket_config called\n"); |
226 | 223 | ||
@@ -235,9 +232,17 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
235 | strcpy(chip->card->driver, vxp440_hw.name); | 232 | strcpy(chip->card->driver, vxp440_hw.name); |
236 | } | 233 | } |
237 | 234 | ||
238 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | 235 | ret = pcmcia_request_io(link, &link->io); |
239 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 236 | if (ret) |
240 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 237 | goto failed; |
238 | |||
239 | ret = pcmcia_request_irq(link, &link->irq); | ||
240 | if (ret) | ||
241 | goto failed; | ||
242 | |||
243 | ret = pcmcia_request_configuration(link, &link->conf); | ||
244 | if (ret) | ||
245 | goto failed; | ||
241 | 246 | ||
242 | chip->dev = &handle_to_dev(link); | 247 | chip->dev = &handle_to_dev(link); |
243 | snd_card_set_dev(chip->card, chip->dev); | 248 | snd_card_set_dev(chip->card, chip->dev); |
@@ -248,8 +253,6 @@ static int vxpocket_config(struct pcmcia_device *link) | |||
248 | link->dev_node = &vxp->node; | 253 | link->dev_node = &vxp->node; |
249 | return 0; | 254 | return 0; |
250 | 255 | ||
251 | cs_failed: | ||
252 | cs_error(link, last_fn, last_ret); | ||
253 | failed: | 256 | failed: |
254 | pcmcia_disable_device(link); | 257 | pcmcia_disable_device(link); |
255 | return -ENODEV; | 258 | return -ENODEV; |