Commit e7891ba2 authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville
Browse files

mwifiex: use usleep_range instead of udelay



For the delay of 10 uSec or more usleep_range is prefered.
Unlike udelay, sleep_range avoids large number of undesired
interrupts.

Ref Documentation/timers/timers-howto.txt
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6685d109
...@@ -288,7 +288,7 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter) ...@@ -288,7 +288,7 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter)
while (mwifiex_pcie_ok_to_access_hw(adapter)) { while (mwifiex_pcie_ok_to_access_hw(adapter)) {
i++; i++;
udelay(10); usleep_range(10, 20);
/* 50ms max wait */ /* 50ms max wait */
if (i == 50000) if (i == 50000)
break; break;
...@@ -1088,7 +1088,7 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter) ...@@ -1088,7 +1088,7 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
card->cmdrsp_buf->len); card->cmdrsp_buf->len);
while (mwifiex_pcie_ok_to_access_hw(adapter) && while (mwifiex_pcie_ok_to_access_hw(adapter) &&
(count++ < 10)) (count++ < 10))
udelay(50); usleep_range(50, 60);
} else { } else {
dev_err(adapter->dev, "There is no command but " dev_err(adapter->dev, "There is no command but "
"got cmdrsp\n"); "got cmdrsp\n");
...@@ -1337,7 +1337,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, ...@@ -1337,7 +1337,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
} }
if (len) if (len)
break; break;
udelay(10); usleep_range(10, 20);
} }
if (!len) { if (!len) {
......
...@@ -583,7 +583,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits) ...@@ -583,7 +583,7 @@ mwifiex_sdio_poll_card_status(struct mwifiex_adapter *adapter, u8 bits)
else if ((cs & bits) == bits) else if ((cs & bits) == bits)
return 0; return 0;
udelay(10); usleep_range(10, 20);
} }
dev_err(adapter->dev, "poll card status failed, tries = %d\n", dev_err(adapter->dev, "poll card status failed, tries = %d\n",
...@@ -761,7 +761,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter, ...@@ -761,7 +761,7 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
if (len) if (len)
break; break;
udelay(10); usleep_range(10, 20);
} }
if (!len) { if (!len) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment