diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:26:06 -0500 |
commit | 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch) | |
tree | cfb8897487beba502aac2b28bc35066a87e34299 /drivers/bluetooth/bt3c_cs.c | |
parent | fba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff) |
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth/bt3c_cs.c')
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 7ea8fa350d26..80861f4f35e3 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -88,7 +88,7 @@ typedef struct bt3c_info_t { | |||
88 | } bt3c_info_t; | 88 | } bt3c_info_t; |
89 | 89 | ||
90 | 90 | ||
91 | static void bt3c_config(struct pcmcia_device *link); | 91 | static int bt3c_config(struct pcmcia_device *link); |
92 | static void bt3c_release(struct pcmcia_device *link); | 92 | static void bt3c_release(struct pcmcia_device *link); |
93 | 93 | ||
94 | static void bt3c_detach(struct pcmcia_device *p_dev); | 94 | static void bt3c_detach(struct pcmcia_device *p_dev); |
@@ -645,7 +645,7 @@ static int bt3c_close(bt3c_info_t *info) | |||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||
648 | static int bt3c_attach(struct pcmcia_device *link) | 648 | static int bt3c_probe(struct pcmcia_device *link) |
649 | { | 649 | { |
650 | bt3c_info_t *info; | 650 | bt3c_info_t *info; |
651 | 651 | ||
@@ -669,9 +669,7 @@ static int bt3c_attach(struct pcmcia_device *link) | |||
669 | link->conf.IntType = INT_MEMORY_AND_IO; | 669 | link->conf.IntType = INT_MEMORY_AND_IO; |
670 | 670 | ||
671 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 671 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
672 | bt3c_config(link); | 672 | return bt3c_config(link); |
673 | |||
674 | return 0; | ||
675 | } | 673 | } |
676 | 674 | ||
677 | 675 | ||
@@ -710,7 +708,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * | |||
710 | return get_tuple(handle, tuple, parse); | 708 | return get_tuple(handle, tuple, parse); |
711 | } | 709 | } |
712 | 710 | ||
713 | static void bt3c_config(struct pcmcia_device *link) | 711 | static int bt3c_config(struct pcmcia_device *link) |
714 | { | 712 | { |
715 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 713 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
716 | bt3c_info_t *info = link->priv; | 714 | bt3c_info_t *info = link->priv; |
@@ -809,13 +807,14 @@ found_port: | |||
809 | link->dev_node = &info->node; | 807 | link->dev_node = &info->node; |
810 | link->state &= ~DEV_CONFIG_PENDING; | 808 | link->state &= ~DEV_CONFIG_PENDING; |
811 | 809 | ||
812 | return; | 810 | return 0; |
813 | 811 | ||
814 | cs_failed: | 812 | cs_failed: |
815 | cs_error(link, last_fn, last_ret); | 813 | cs_error(link, last_fn, last_ret); |
816 | 814 | ||
817 | failed: | 815 | failed: |
818 | bt3c_release(link); | 816 | bt3c_release(link); |
817 | return -ENODEV; | ||
819 | } | 818 | } |
820 | 819 | ||
821 | 820 | ||
@@ -841,7 +840,7 @@ static struct pcmcia_driver bt3c_driver = { | |||
841 | .drv = { | 840 | .drv = { |
842 | .name = "bt3c_cs", | 841 | .name = "bt3c_cs", |
843 | }, | 842 | }, |
844 | .probe = bt3c_attach, | 843 | .probe = bt3c_probe, |
845 | .remove = bt3c_detach, | 844 | .remove = bt3c_detach, |
846 | .id_table = bt3c_ids, | 845 | .id_table = bt3c_ids, |
847 | }; | 846 | }; |