aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c21
-rw-r--r--sound/pcmcia/vx/vxpocket.c21
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) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223static int pdacf_config(struct pcmcia_device *link) 220static 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
241cs_failed:
242 cs_error(link, last_fn, last_ret);
243failed: 246failed:
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) \
217do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
218
219static int vxpocket_config(struct pcmcia_device *link) 216static 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
251cs_failed:
252 cs_error(link, last_fn, last_ret);
253failed: 256failed:
254 pcmcia_disable_device(link); 257 pcmcia_disable_device(link);
255 return -ENODEV; 258 return -ENODEV;