aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/bluetooth
parentfba395eee7d3f342ca739c20f5b3ee635d0420a0 (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')
-rw-r--r--drivers/bluetooth/bluecard_cs.c15
-rw-r--r--drivers/bluetooth/bt3c_cs.c15
-rw-r--r--drivers/bluetooth/btuart_cs.c15
-rw-r--r--drivers/bluetooth/dtl1_cs.c15
4 files changed, 28 insertions, 32 deletions
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index e557f2359ccc..50174fb107a8 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -85,7 +85,7 @@ typedef struct bluecard_info_t {
85} bluecard_info_t; 85} bluecard_info_t;
86 86
87 87
88static void bluecard_config(struct pcmcia_device *link); 88static int bluecard_config(struct pcmcia_device *link);
89static void bluecard_release(struct pcmcia_device *link); 89static void bluecard_release(struct pcmcia_device *link);
90 90
91static void bluecard_detach(struct pcmcia_device *p_dev); 91static void bluecard_detach(struct pcmcia_device *p_dev);
@@ -856,7 +856,7 @@ static int bluecard_close(bluecard_info_t *info)
856 return 0; 856 return 0;
857} 857}
858 858
859static int bluecard_attach(struct pcmcia_device *link) 859static int bluecard_probe(struct pcmcia_device *link)
860{ 860{
861 bluecard_info_t *info; 861 bluecard_info_t *info;
862 862
@@ -880,9 +880,7 @@ static int bluecard_attach(struct pcmcia_device *link)
880 link->conf.IntType = INT_MEMORY_AND_IO; 880 link->conf.IntType = INT_MEMORY_AND_IO;
881 881
882 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 882 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
883 bluecard_config(link); 883 return bluecard_config(link);
884
885 return 0;
886} 884}
887 885
888 886
@@ -912,7 +910,7 @@ static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t
912 return pcmcia_parse_tuple(handle, tuple, parse); 910 return pcmcia_parse_tuple(handle, tuple, parse);
913} 911}
914 912
915static void bluecard_config(struct pcmcia_device *link) 913static int bluecard_config(struct pcmcia_device *link)
916{ 914{
917 bluecard_info_t *info = link->priv; 915 bluecard_info_t *info = link->priv;
918 tuple_t tuple; 916 tuple_t tuple;
@@ -973,13 +971,14 @@ static void bluecard_config(struct pcmcia_device *link)
973 link->dev_node = &info->node; 971 link->dev_node = &info->node;
974 link->state &= ~DEV_CONFIG_PENDING; 972 link->state &= ~DEV_CONFIG_PENDING;
975 973
976 return; 974 return 0;
977 975
978cs_failed: 976cs_failed:
979 cs_error(link, last_fn, last_ret); 977 cs_error(link, last_fn, last_ret);
980 978
981failed: 979failed:
982 bluecard_release(link); 980 bluecard_release(link);
981 return -ENODEV;
983} 982}
984 983
985 984
@@ -1008,7 +1007,7 @@ static struct pcmcia_driver bluecard_driver = {
1008 .drv = { 1007 .drv = {
1009 .name = "bluecard_cs", 1008 .name = "bluecard_cs",
1010 }, 1009 },
1011 .probe = bluecard_attach, 1010 .probe = bluecard_probe,
1012 .remove = bluecard_detach, 1011 .remove = bluecard_detach,
1013 .id_table = bluecard_ids, 1012 .id_table = bluecard_ids,
1014}; 1013};
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
91static void bt3c_config(struct pcmcia_device *link); 91static int bt3c_config(struct pcmcia_device *link);
92static void bt3c_release(struct pcmcia_device *link); 92static void bt3c_release(struct pcmcia_device *link);
93 93
94static void bt3c_detach(struct pcmcia_device *p_dev); 94static 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
648static int bt3c_attach(struct pcmcia_device *link) 648static 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
713static void bt3c_config(struct pcmcia_device *link) 711static 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
814cs_failed: 812cs_failed:
815 cs_error(link, last_fn, last_ret); 813 cs_error(link, last_fn, last_ret);
816 814
817failed: 815failed:
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};
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
87static void btuart_config(struct pcmcia_device *link); 87static int btuart_config(struct pcmcia_device *link);
88static void btuart_release(struct pcmcia_device *link); 88static void btuart_release(struct pcmcia_device *link);
89 89
90static void btuart_detach(struct pcmcia_device *p_dev); 90static 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
579static int btuart_attach(struct pcmcia_device *link) 579static 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
644static void btuart_config(struct pcmcia_device *link) 642static 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
746cs_failed: 744cs_failed:
747 cs_error(link, last_fn, last_ret); 745 cs_error(link, last_fn, last_ret);
748 746
749failed: 747failed:
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};
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 416433b4a348..0ec7fd4c9214 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -87,7 +87,7 @@ typedef struct dtl1_info_t {
87} dtl1_info_t; 87} dtl1_info_t;
88 88
89 89
90static void dtl1_config(struct pcmcia_device *link); 90static int dtl1_config(struct pcmcia_device *link);
91static void dtl1_release(struct pcmcia_device *link); 91static void dtl1_release(struct pcmcia_device *link);
92 92
93static void dtl1_detach(struct pcmcia_device *p_dev); 93static void dtl1_detach(struct pcmcia_device *p_dev);
@@ -555,7 +555,7 @@ static int dtl1_close(dtl1_info_t *info)
555 return 0; 555 return 0;
556} 556}
557 557
558static int dtl1_attach(struct pcmcia_device *link) 558static int dtl1_probe(struct pcmcia_device *link)
559{ 559{
560 dtl1_info_t *info; 560 dtl1_info_t *info;
561 561
@@ -579,9 +579,7 @@ static int dtl1_attach(struct pcmcia_device *link)
579 link->conf.IntType = INT_MEMORY_AND_IO; 579 link->conf.IntType = INT_MEMORY_AND_IO;
580 580
581 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 581 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
582 dtl1_config(link); 582 return dtl1_config(link);
583
584 return 0;
585} 583}
586 584
587 585
@@ -620,7 +618,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
620 return get_tuple(handle, tuple, parse); 618 return get_tuple(handle, tuple, parse);
621} 619}
622 620
623static void dtl1_config(struct pcmcia_device *link) 621static int dtl1_config(struct pcmcia_device *link)
624{ 622{
625 dtl1_info_t *info = link->priv; 623 dtl1_info_t *info = link->priv;
626 tuple_t tuple; 624 tuple_t tuple;
@@ -693,13 +691,14 @@ static void dtl1_config(struct pcmcia_device *link)
693 link->dev_node = &info->node; 691 link->dev_node = &info->node;
694 link->state &= ~DEV_CONFIG_PENDING; 692 link->state &= ~DEV_CONFIG_PENDING;
695 693
696 return; 694 return 0;
697 695
698cs_failed: 696cs_failed:
699 cs_error(link, last_fn, last_ret); 697 cs_error(link, last_fn, last_ret);
700 698
701failed: 699failed:
702 dtl1_release(link); 700 dtl1_release(link);
701 return -ENODEV;
703} 702}
704 703
705 704
@@ -727,7 +726,7 @@ static struct pcmcia_driver dtl1_driver = {
727 .drv = { 726 .drv = {
728 .name = "dtl1_cs", 727 .name = "dtl1_cs",
729 }, 728 },
730 .probe = dtl1_attach, 729 .probe = dtl1_probe,
731 .remove = dtl1_detach, 730 .remove = dtl1_detach,
732 .id_table = dtl1_ids, 731 .id_table = dtl1_ids,
733}; 732};