diff options
author | Devendra Naga <devendra.aaru@gmail.com> | 2012-06-19 12:21:31 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-06-30 10:44:36 -0400 |
commit | 46afededca7d8b0117e05b23e5cbcfa0e2bbbd92 (patch) | |
tree | f3aaf5dec0793f991a2e16675cb156fa9ec7559c /drivers/bluetooth/dtl1_cs.c | |
parent | 38b3fef1730319e2730af3fc9f73698e3a9aeb4a (diff) |
Bluetooth: cleanup dtl1_config
Improve the error handling of dtl1_config()
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'drivers/bluetooth/dtl1_cs.c')
-rw-r--r-- | drivers/bluetooth/dtl1_cs.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index b1b37ccd3cd4..97a7784db4a2 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c | |||
@@ -586,29 +586,31 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) | |||
586 | static int dtl1_config(struct pcmcia_device *link) | 586 | static int dtl1_config(struct pcmcia_device *link) |
587 | { | 587 | { |
588 | dtl1_info_t *info = link->priv; | 588 | dtl1_info_t *info = link->priv; |
589 | int i; | 589 | int ret; |
590 | 590 | ||
591 | /* Look for a generic full-sized window */ | 591 | /* Look for a generic full-sized window */ |
592 | link->resource[0]->end = 8; | 592 | link->resource[0]->end = 8; |
593 | if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0) | 593 | ret = pcmcia_loop_config(link, dtl1_confcheck, NULL); |
594 | if (ret) | ||
594 | goto failed; | 595 | goto failed; |
595 | 596 | ||
596 | i = pcmcia_request_irq(link, dtl1_interrupt); | 597 | ret = pcmcia_request_irq(link, dtl1_interrupt); |
597 | if (i != 0) | 598 | if (ret) |
598 | goto failed; | 599 | goto failed; |
599 | 600 | ||
600 | i = pcmcia_enable_device(link); | 601 | ret = pcmcia_enable_device(link); |
601 | if (i != 0) | 602 | if (ret) |
602 | goto failed; | 603 | goto failed; |
603 | 604 | ||
604 | if (dtl1_open(info) != 0) | 605 | ret = dtl1_open(info); |
606 | if (ret) | ||
605 | goto failed; | 607 | goto failed; |
606 | 608 | ||
607 | return 0; | 609 | return 0; |
608 | 610 | ||
609 | failed: | 611 | failed: |
610 | dtl1_detach(link); | 612 | dtl1_detach(link); |
611 | return -ENODEV; | 613 | return ret; |
612 | } | 614 | } |
613 | 615 | ||
614 | static const struct pcmcia_device_id dtl1_ids[] = { | 616 | static const struct pcmcia_device_id dtl1_ids[] = { |