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/btuart_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/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 594839061360..658a1373699e 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -84,7 +84,7 @@ typedef struct btuart_info_t { | |||
84 | } btuart_info_t; | 84 | } btuart_info_t; |
85 | 85 | ||
86 | 86 | ||
87 | static void btuart_config(struct pcmcia_device *link); | 87 | static int btuart_config(struct pcmcia_device *link); |
88 | static void btuart_release(struct pcmcia_device *link); | 88 | static void btuart_release(struct pcmcia_device *link); |
89 | 89 | ||
90 | static void btuart_detach(struct pcmcia_device *p_dev); | 90 | static void btuart_detach(struct pcmcia_device *p_dev); |
@@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info) | |||
576 | return 0; | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | static int btuart_attach(struct pcmcia_device *link) | 579 | static int btuart_probe(struct pcmcia_device *link) |
580 | { | 580 | { |
581 | btuart_info_t *info; | 581 | btuart_info_t *info; |
582 | 582 | ||
@@ -600,9 +600,7 @@ static int btuart_attach(struct pcmcia_device *link) | |||
600 | link->conf.IntType = INT_MEMORY_AND_IO; | 600 | link->conf.IntType = INT_MEMORY_AND_IO; |
601 | 601 | ||
602 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 602 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
603 | btuart_config(link); | 603 | return btuart_config(link); |
604 | |||
605 | return 0; | ||
606 | } | 604 | } |
607 | 605 | ||
608 | 606 | ||
@@ -641,7 +639,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t * | |||
641 | return get_tuple(handle, tuple, parse); | 639 | return get_tuple(handle, tuple, parse); |
642 | } | 640 | } |
643 | 641 | ||
644 | static void btuart_config(struct pcmcia_device *link) | 642 | static int btuart_config(struct pcmcia_device *link) |
645 | { | 643 | { |
646 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 644 | static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
647 | btuart_info_t *info = link->priv; | 645 | btuart_info_t *info = link->priv; |
@@ -741,13 +739,14 @@ found_port: | |||
741 | link->dev_node = &info->node; | 739 | link->dev_node = &info->node; |
742 | link->state &= ~DEV_CONFIG_PENDING; | 740 | link->state &= ~DEV_CONFIG_PENDING; |
743 | 741 | ||
744 | return; | 742 | return 0; |
745 | 743 | ||
746 | cs_failed: | 744 | cs_failed: |
747 | cs_error(link, last_fn, last_ret); | 745 | cs_error(link, last_fn, last_ret); |
748 | 746 | ||
749 | failed: | 747 | failed: |
750 | btuart_release(link); | 748 | btuart_release(link); |
749 | return -ENODEV; | ||
751 | } | 750 | } |
752 | 751 | ||
753 | 752 | ||
@@ -772,7 +771,7 @@ static struct pcmcia_driver btuart_driver = { | |||
772 | .drv = { | 771 | .drv = { |
773 | .name = "btuart_cs", | 772 | .name = "btuart_cs", |
774 | }, | 773 | }, |
775 | .probe = btuart_attach, | 774 | .probe = btuart_probe, |
776 | .remove = btuart_detach, | 775 | .remove = btuart_detach, |
777 | .id_table = btuart_ids, | 776 | .id_table = btuart_ids, |
778 | }; | 777 | }; |