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