diff options
Diffstat (limited to 'sound/pcmcia/pdaudiocf/pdaudiocf.c')
-rw-r--r-- | sound/pcmcia/pdaudiocf/pdaudiocf.c | 21 |
1 files changed, 12 insertions, 9 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; |