diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index 758d5ac81ecc..c63488c54f4a 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
@@ -228,9 +228,8 @@ failed: | |||
228 | static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card, | 228 | static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card, |
229 | int pollnum) | 229 | int pollnum) |
230 | { | 230 | { |
231 | int ret = -ETIMEDOUT; | ||
232 | u16 firmwarestat; | 231 | u16 firmwarestat; |
233 | unsigned int tries; | 232 | int tries, ret; |
234 | 233 | ||
235 | /* Wait for firmware to become ready */ | 234 | /* Wait for firmware to become ready */ |
236 | for (tries = 0; tries < pollnum; tries++) { | 235 | for (tries = 0; tries < pollnum; tries++) { |
@@ -240,15 +239,13 @@ static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card, | |||
240 | if (ret < 0) | 239 | if (ret < 0) |
241 | continue; | 240 | continue; |
242 | 241 | ||
243 | if (firmwarestat == FIRMWARE_READY) { | 242 | if (firmwarestat == FIRMWARE_READY) |
244 | ret = 0; | 243 | return 0; |
245 | break; | 244 | |
246 | } else { | 245 | msleep(10); |
247 | msleep(10); | ||
248 | } | ||
249 | } | 246 | } |
250 | 247 | ||
251 | return ret; | 248 | return -ETIMEDOUT; |
252 | } | 249 | } |
253 | 250 | ||
254 | static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card) | 251 | static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card) |
@@ -924,6 +921,10 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card) | |||
924 | 921 | ||
925 | sdio_release_host(card->func); | 922 | sdio_release_host(card->func); |
926 | 923 | ||
924 | /* | ||
925 | * winner or not, with this test the FW synchronizes when the | ||
926 | * module can continue its initialization | ||
927 | */ | ||
927 | if (btmrvl_sdio_verify_fw_download(card, pollnum)) { | 928 | if (btmrvl_sdio_verify_fw_download(card, pollnum)) { |
928 | BT_ERR("FW failed to be active in time!"); | 929 | BT_ERR("FW failed to be active in time!"); |
929 | return -ETIMEDOUT; | 930 | return -ETIMEDOUT; |
@@ -995,8 +996,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, | |||
995 | goto unreg_dev; | 996 | goto unreg_dev; |
996 | } | 997 | } |
997 | 998 | ||
998 | msleep(100); | ||
999 | |||
1000 | btmrvl_sdio_enable_host_int(card); | 999 | btmrvl_sdio_enable_host_int(card); |
1001 | 1000 | ||
1002 | priv = btmrvl_add_card(card); | 1001 | priv = btmrvl_add_card(card); |