aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btmrvl_sdio.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-06-13 01:40:18 -0400
committerMarcel Holtmann <marcel@holtmann.org>2009-08-22 17:25:34 -0400
commit9374253ffe609f2d70dd5ae280182cb6f08fef08 (patch)
treed84aabb99ba9b83f170dacb3caef3b9540420ea1 /drivers/bluetooth/btmrvl_sdio.c
parente0721f99ba33d13a88746732be2d74ca805abf55 (diff)
Bluetooth: Remove Enter/Leave debug statements from Marvell driver
The Marvell Bluetooth driver is full of Enter/Leave debug statements and all of them are really pointless and only clutter the code. Seems to be some left-overs when they ported the driver from Windows. For the Linux driver lets remove these. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btmrvl_sdio.c')
-rw-r--r--drivers/bluetooth/btmrvl_sdio.c135
1 files changed, 12 insertions, 123 deletions
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 7638f62e8a06..224af53e0fae 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -67,23 +67,17 @@ static int btmrvl_sdio_get_rx_unit(struct btmrvl_sdio_card *card)
67 u8 reg; 67 u8 reg;
68 int ret; 68 int ret;
69 69
70 BT_DBG("Enter");
71
72 reg = sdio_readb(card->func, CARD_RX_UNIT_REG, &ret); 70 reg = sdio_readb(card->func, CARD_RX_UNIT_REG, &ret);
73 if (!ret) 71 if (!ret)
74 card->rx_unit = reg; 72 card->rx_unit = reg;
75 73
76 BT_DBG("Leave");
77
78 return ret; 74 return ret;
79} 75}
80 76
81static int btmrvl_sdio_read_fw_status(struct btmrvl_sdio_card *card, u16 *dat) 77static int btmrvl_sdio_read_fw_status(struct btmrvl_sdio_card *card, u16 *dat)
82{ 78{
83 int ret;
84 u8 fws0, fws1; 79 u8 fws0, fws1;
85 80 int ret;
86 BT_DBG("Enter");
87 81
88 *dat = 0; 82 *dat = 0;
89 83
@@ -92,31 +86,23 @@ static int btmrvl_sdio_read_fw_status(struct btmrvl_sdio_card *card, u16 *dat)
92 if (!ret) 86 if (!ret)
93 fws1 = sdio_readb(card->func, CARD_FW_STATUS1_REG, &ret); 87 fws1 = sdio_readb(card->func, CARD_FW_STATUS1_REG, &ret);
94 88
95 if (ret) { 89 if (ret)
96 BT_DBG("Leave");
97 return -EIO; 90 return -EIO;
98 }
99 91
100 *dat = (((u16) fws1) << 8) | fws0; 92 *dat = (((u16) fws1) << 8) | fws0;
101 93
102 BT_DBG("Leave");
103
104 return 0; 94 return 0;
105} 95}
106 96
107static int btmrvl_sdio_read_rx_len(struct btmrvl_sdio_card *card, u16 *dat) 97static int btmrvl_sdio_read_rx_len(struct btmrvl_sdio_card *card, u16 *dat)
108{ 98{
109 int ret;
110 u8 reg; 99 u8 reg;
111 100 int ret;
112 BT_DBG("Enter");
113 101
114 reg = sdio_readb(card->func, CARD_RX_LEN_REG, &ret); 102 reg = sdio_readb(card->func, CARD_RX_LEN_REG, &ret);
115 if (!ret) 103 if (!ret)
116 *dat = (u16) reg << card->rx_unit; 104 *dat = (u16) reg << card->rx_unit;
117 105
118 BT_DBG("Leave");
119
120 return ret; 106 return ret;
121} 107}
122 108
@@ -125,64 +111,48 @@ static int btmrvl_sdio_enable_host_int_mask(struct btmrvl_sdio_card *card,
125{ 111{
126 int ret; 112 int ret;
127 113
128 BT_DBG("Enter");
129
130 sdio_writeb(card->func, mask, HOST_INT_MASK_REG, &ret); 114 sdio_writeb(card->func, mask, HOST_INT_MASK_REG, &ret);
131 if (ret) { 115 if (ret) {
132 BT_ERR("Unable to enable the host interrupt!"); 116 BT_ERR("Unable to enable the host interrupt!");
133 ret = -EIO; 117 ret = -EIO;
134 } 118 }
135 119
136 BT_DBG("Leave");
137
138 return ret; 120 return ret;
139} 121}
140 122
141static int btmrvl_sdio_disable_host_int_mask(struct btmrvl_sdio_card *card, 123static int btmrvl_sdio_disable_host_int_mask(struct btmrvl_sdio_card *card,
142 u8 mask) 124 u8 mask)
143{ 125{
144 int ret;
145 u8 host_int_mask; 126 u8 host_int_mask;
146 127 int ret;
147 BT_DBG("Enter");
148 128
149 host_int_mask = sdio_readb(card->func, HOST_INT_MASK_REG, &ret); 129 host_int_mask = sdio_readb(card->func, HOST_INT_MASK_REG, &ret);
150 if (ret) { 130 if (ret)
151 ret = -EIO; 131 return -EIO;
152 goto done;
153 }
154 132
155 host_int_mask &= ~mask; 133 host_int_mask &= ~mask;
156 134
157 sdio_writeb(card->func, host_int_mask, HOST_INT_MASK_REG, &ret); 135 sdio_writeb(card->func, host_int_mask, HOST_INT_MASK_REG, &ret);
158 if (ret < 0) { 136 if (ret < 0) {
159 BT_ERR("Unable to disable the host interrupt!"); 137 BT_ERR("Unable to disable the host interrupt!");
160 ret = -EIO; 138 return -EIO;
161 goto done;
162 } 139 }
163 140
164 ret = 0; 141 return 0;
165
166done:
167 BT_DBG("Leave");
168
169 return ret;
170} 142}
171 143
172static int btmrvl_sdio_poll_card_status(struct btmrvl_sdio_card *card, u8 bits) 144static int btmrvl_sdio_poll_card_status(struct btmrvl_sdio_card *card, u8 bits)
173{ 145{
174 unsigned int tries; 146 unsigned int tries;
175 int ret;
176 u8 status; 147 u8 status;
177 148 int ret;
178 BT_DBG("Enter");
179 149
180 for (tries = 0; tries < MAX_POLL_TRIES * 1000; tries++) { 150 for (tries = 0; tries < MAX_POLL_TRIES * 1000; tries++) {
181 status = sdio_readb(card->func, CARD_STATUS_REG, &ret); 151 status = sdio_readb(card->func, CARD_STATUS_REG, &ret);
182 if (ret) 152 if (ret)
183 goto failed; 153 goto failed;
184 if ((status & bits) == bits) 154 if ((status & bits) == bits)
185 goto done; 155 return ret;
186 156
187 udelay(1); 157 udelay(1);
188 } 158 }
@@ -192,9 +162,6 @@ static int btmrvl_sdio_poll_card_status(struct btmrvl_sdio_card *card, u8 bits)
192failed: 162failed:
193 BT_ERR("FAILED! ret=%d", ret); 163 BT_ERR("FAILED! ret=%d", ret);
194 164
195done:
196 BT_DBG("Leave");
197
198 return ret; 165 return ret;
199} 166}
200 167
@@ -205,8 +172,6 @@ static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card,
205 u16 firmwarestat; 172 u16 firmwarestat;
206 unsigned int tries; 173 unsigned int tries;
207 174
208 BT_DBG("Enter");
209
210 /* Wait for firmware to become ready */ 175 /* Wait for firmware to become ready */
211 for (tries = 0; tries < pollnum; tries++) { 176 for (tries = 0; tries < pollnum; tries++) {
212 if (btmrvl_sdio_read_fw_status(card, &firmwarestat) < 0) 177 if (btmrvl_sdio_read_fw_status(card, &firmwarestat) < 0)
@@ -220,8 +185,6 @@ static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card,
220 } 185 }
221 } 186 }
222 187
223 BT_DBG("Leave");
224
225 return ret; 188 return ret;
226} 189}
227 190
@@ -235,8 +198,6 @@ static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card)
235 u8 *helperbuf; 198 u8 *helperbuf;
236 u32 tx_len; 199 u32 tx_len;
237 200
238 BT_DBG("Enter");
239
240 ret = request_firmware(&fw_helper, card->helper, 201 ret = request_firmware(&fw_helper, card->helper,
241 &card->func->dev); 202 &card->func->dev);
242 if ((ret < 0) || !fw_helper) { 203 if ((ret < 0) || !fw_helper) {
@@ -326,8 +287,6 @@ done:
326 if (fw_helper) 287 if (fw_helper)
327 release_firmware(fw_helper); 288 release_firmware(fw_helper);
328 289
329 BT_DBG("Leave");
330
331 return ret; 290 return ret;
332} 291}
333 292
@@ -343,8 +302,6 @@ static int btmrvl_sdio_download_fw_w_helper(struct btmrvl_sdio_card *card)
343 u16 len; 302 u16 len;
344 int txlen = 0, tx_blocks = 0, count = 0; 303 int txlen = 0, tx_blocks = 0, count = 0;
345 304
346 BT_DBG("Enter");
347
348 ret = request_firmware(&fw_firmware, card->firmware, 305 ret = request_firmware(&fw_firmware, card->firmware,
349 &card->func->dev); 306 &card->func->dev);
350 if ((ret < 0) || !fw_firmware) { 307 if ((ret < 0) || !fw_firmware) {
@@ -479,8 +436,6 @@ done:
479 if (fw_firmware) 436 if (fw_firmware)
480 release_firmware(fw_firmware); 437 release_firmware(fw_firmware);
481 438
482 BT_DBG("Leave");
483
484 return ret; 439 return ret;
485} 440}
486 441
@@ -494,8 +449,6 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
494 struct hci_dev *hdev = priv->btmrvl_dev.hcidev; 449 struct hci_dev *hdev = priv->btmrvl_dev.hcidev;
495 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card; 450 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
496 451
497 BT_DBG("Enter");
498
499 if (!card || !card->func) { 452 if (!card || !card->func) {
500 BT_ERR("card or function is NULL!"); 453 BT_ERR("card or function is NULL!");
501 ret = -EINVAL; 454 ret = -EINVAL;
@@ -596,8 +549,6 @@ exit:
596 kfree_skb(skb); 549 kfree_skb(skb);
597 } 550 }
598 551
599 BT_DBG("Leave");
600
601 return ret; 552 return ret;
602} 553}
603 554
@@ -607,8 +558,6 @@ static int btmrvl_sdio_get_int_status(struct btmrvl_private *priv, u8 * ireg)
607 u8 sdio_ireg = 0; 558 u8 sdio_ireg = 0;
608 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card; 559 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
609 560
610 BT_DBG("Enter");
611
612 *ireg = 0; 561 *ireg = 0;
613 562
614 sdio_ireg = sdio_readb(card->func, HOST_INTSTATUS_REG, &ret); 563 sdio_ireg = sdio_readb(card->func, HOST_INTSTATUS_REG, &ret);
@@ -653,8 +602,6 @@ static int btmrvl_sdio_get_int_status(struct btmrvl_private *priv, u8 * ireg)
653 ret = 0; 602 ret = 0;
654 603
655done: 604done:
656 BT_DBG("Leave");
657
658 return ret; 605 return ret;
659} 606}
660 607
@@ -665,8 +612,6 @@ static void btmrvl_sdio_interrupt(struct sdio_func *func)
665 struct btmrvl_sdio_card *card; 612 struct btmrvl_sdio_card *card;
666 u8 ireg = 0; 613 u8 ireg = 0;
667 614
668 BT_DBG("Enter");
669
670 card = sdio_get_drvdata(func); 615 card = sdio_get_drvdata(func);
671 if (card && card->priv) { 616 if (card && card->priv) {
672 priv = card->priv; 617 priv = card->priv;
@@ -679,8 +624,6 @@ static void btmrvl_sdio_interrupt(struct sdio_func *func)
679 624
680 btmrvl_interrupt(priv); 625 btmrvl_interrupt(priv);
681 } 626 }
682
683 BT_DBG("Leave");
684} 627}
685 628
686static int btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card) 629static int btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card)
@@ -689,8 +632,6 @@ static int btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card)
689 u8 reg; 632 u8 reg;
690 int ret = 0; 633 int ret = 0;
691 634
692 BT_DBG("Enter");
693
694 if (!card || !card->func) { 635 if (!card || !card->func) {
695 BT_ERR("Error: card or function is NULL!"); 636 BT_ERR("Error: card or function is NULL!");
696 ret = -EINVAL; 637 ret = -EINVAL;
@@ -752,7 +693,6 @@ static int btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card)
752 693
753 sdio_release_host(func); 694 sdio_release_host(func);
754 695
755 BT_DBG("Leave");
756 return 0; 696 return 0;
757 697
758release_irq: 698release_irq:
@@ -765,14 +705,11 @@ release_host:
765 sdio_release_host(func); 705 sdio_release_host(func);
766 706
767failed: 707failed:
768 BT_DBG("Leave");
769 return ret; 708 return ret;
770} 709}
771 710
772static int btmrvl_sdio_unregister_dev(struct btmrvl_sdio_card *card) 711static int btmrvl_sdio_unregister_dev(struct btmrvl_sdio_card *card)
773{ 712{
774 BT_DBG("Enter");
775
776 if (card && card->func) { 713 if (card && card->func) {
777 sdio_claim_host(card->func); 714 sdio_claim_host(card->func);
778 sdio_release_irq(card->func); 715 sdio_release_irq(card->func);
@@ -781,8 +718,6 @@ static int btmrvl_sdio_unregister_dev(struct btmrvl_sdio_card *card)
781 sdio_set_drvdata(card->func, NULL); 718 sdio_set_drvdata(card->func, NULL);
782 } 719 }
783 720
784 BT_DBG("Leave");
785
786 return 0; 721 return 0;
787} 722}
788 723
@@ -790,12 +725,8 @@ static int btmrvl_sdio_enable_host_int(struct btmrvl_sdio_card *card)
790{ 725{
791 int ret; 726 int ret;
792 727
793 BT_DBG("Enter"); 728 if (!card || !card->func)
794
795 if (!card || !card->func) {
796 BT_DBG("Leave");
797 return -EINVAL; 729 return -EINVAL;
798 }
799 730
800 sdio_claim_host(card->func); 731 sdio_claim_host(card->func);
801 732
@@ -805,8 +736,6 @@ static int btmrvl_sdio_enable_host_int(struct btmrvl_sdio_card *card)
805 736
806 sdio_release_host(card->func); 737 sdio_release_host(card->func);
807 738
808 BT_DBG("Leave");
809
810 return ret; 739 return ret;
811} 740}
812 741
@@ -814,12 +743,8 @@ static int btmrvl_sdio_disable_host_int(struct btmrvl_sdio_card *card)
814{ 743{
815 int ret; 744 int ret;
816 745
817 BT_DBG("Enter"); 746 if (!card || !card->func)
818
819 if (!card || !card->func) {
820 BT_DBG("Leave");
821 return -EINVAL; 747 return -EINVAL;
822 }
823 748
824 sdio_claim_host(card->func); 749 sdio_claim_host(card->func);
825 750
@@ -827,8 +752,6 @@ static int btmrvl_sdio_disable_host_int(struct btmrvl_sdio_card *card)
827 752
828 sdio_release_host(card->func); 753 sdio_release_host(card->func);
829 754
830 BT_DBG("Leave");
831
832 return ret; 755 return ret;
833} 756}
834 757
@@ -844,11 +767,8 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv,
844 void *tmpbuf = NULL; 767 void *tmpbuf = NULL;
845 int tmpbufsz; 768 int tmpbufsz;
846 769
847 BT_DBG("Enter");
848
849 if (!card || !card->func) { 770 if (!card || !card->func) {
850 BT_ERR("card or function is NULL!"); 771 BT_ERR("card or function is NULL!");
851 BT_DBG("Leave");
852 return -EINVAL; 772 return -EINVAL;
853 } 773 }
854 774
@@ -886,8 +806,6 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv,
886exit: 806exit:
887 sdio_release_host(card->func); 807 sdio_release_host(card->func);
888 808
889 BT_DBG("Leave");
890
891 return ret; 809 return ret;
892} 810}
893 811
@@ -895,11 +813,8 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
895{ 813{
896 int ret = 0; 814 int ret = 0;
897 815
898 BT_DBG("Enter");
899
900 if (!card || !card->func) { 816 if (!card || !card->func) {
901 BT_ERR("card or function is NULL!"); 817 BT_ERR("card or function is NULL!");
902 BT_DBG("Leave");
903 return -EINVAL; 818 return -EINVAL;
904 } 819 }
905 sdio_claim_host(card->func); 820 sdio_claim_host(card->func);
@@ -931,8 +846,6 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
931done: 846done:
932 sdio_release_host(card->func); 847 sdio_release_host(card->func);
933 848
934 BT_DBG("Leave");
935
936 return ret; 849 return ret;
937} 850}
938 851
@@ -941,11 +854,8 @@ static int btmrvl_sdio_wakeup_fw(struct btmrvl_private *priv)
941 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card; 854 struct btmrvl_sdio_card *card = priv->btmrvl_dev.card;
942 int ret = 0; 855 int ret = 0;
943 856
944 BT_DBG("Enter");
945
946 if (!card || !card->func) { 857 if (!card || !card->func) {
947 BT_ERR("card or function is NULL!"); 858 BT_ERR("card or function is NULL!");
948 BT_DBG("Leave");
949 return -EINVAL; 859 return -EINVAL;
950 } 860 }
951 861
@@ -957,8 +867,6 @@ static int btmrvl_sdio_wakeup_fw(struct btmrvl_private *priv)
957 867
958 BT_DBG("wake up firmware"); 868 BT_DBG("wake up firmware");
959 869
960 BT_DBG("Leave");
961
962 return ret; 870 return ret;
963} 871}
964 872
@@ -969,8 +877,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
969 struct btmrvl_private *priv = NULL; 877 struct btmrvl_private *priv = NULL;
970 struct btmrvl_sdio_card *card = NULL; 878 struct btmrvl_sdio_card *card = NULL;
971 879
972 BT_DBG("Enter");
973
974 BT_INFO("vendor=0x%x, device=0x%x, class=%d, fn=%d", 880 BT_INFO("vendor=0x%x, device=0x%x, class=%d, fn=%d",
975 id->vendor, id->device, id->class, func->num); 881 id->vendor, id->device, id->class, func->num);
976 882
@@ -1022,8 +928,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
1022 928
1023 btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ); 929 btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
1024 930
1025 BT_DBG("Leave");
1026
1027 return 0; 931 return 0;
1028 932
1029disable_host_int: 933disable_host_int:
@@ -1033,8 +937,6 @@ unreg_dev:
1033free_card: 937free_card:
1034 kfree(card); 938 kfree(card);
1035done: 939done:
1036 BT_DBG("Leave");
1037
1038 return ret; 940 return ret;
1039} 941}
1040 942
@@ -1042,8 +944,6 @@ static void btmrvl_sdio_remove(struct sdio_func *func)
1042{ 944{
1043 struct btmrvl_sdio_card *card; 945 struct btmrvl_sdio_card *card;
1044 946
1045 BT_DBG("Enter");
1046
1047 if (func) { 947 if (func) {
1048 card = sdio_get_drvdata(func); 948 card = sdio_get_drvdata(func);
1049 if (card) { 949 if (card) {
@@ -1061,8 +961,6 @@ static void btmrvl_sdio_remove(struct sdio_func *func)
1061 kfree(card); 961 kfree(card);
1062 } 962 }
1063 } 963 }
1064
1065 BT_DBG("Leave");
1066} 964}
1067 965
1068static struct sdio_driver bt_mrvl_sdio = { 966static struct sdio_driver bt_mrvl_sdio = {
@@ -1074,32 +972,23 @@ static struct sdio_driver bt_mrvl_sdio = {
1074 972
1075static int btmrvl_sdio_init_module(void) 973static int btmrvl_sdio_init_module(void)
1076{ 974{
1077 BT_DBG("Enter");
1078
1079 if (sdio_register_driver(&bt_mrvl_sdio) != 0) { 975 if (sdio_register_driver(&bt_mrvl_sdio) != 0) {
1080 BT_ERR("SDIO Driver Registration Failed"); 976 BT_ERR("SDIO Driver Registration Failed");
1081 BT_DBG("Leave");
1082 return -ENODEV; 977 return -ENODEV;
1083 } 978 }
1084 979
1085 /* Clear the flag in case user removes the card. */ 980 /* Clear the flag in case user removes the card. */
1086 user_rmmod = 0; 981 user_rmmod = 0;
1087 982
1088 BT_DBG("Leave");
1089
1090 return 0; 983 return 0;
1091} 984}
1092 985
1093static void btmrvl_sdio_exit_module(void) 986static void btmrvl_sdio_exit_module(void)
1094{ 987{
1095 BT_DBG("Enter");
1096
1097 /* Set the flag as user is removing this module. */ 988 /* Set the flag as user is removing this module. */
1098 user_rmmod = 1; 989 user_rmmod = 1;
1099 990
1100 sdio_unregister_driver(&bt_mrvl_sdio); 991 sdio_unregister_driver(&bt_mrvl_sdio);
1101
1102 BT_DBG("Leave");
1103} 992}
1104 993
1105module_init(btmrvl_sdio_init_module); 994module_init(btmrvl_sdio_init_module);