summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/pm.c
diff options
context:
space:
mode:
authorHamad Kadmany <qca_hkadmany@qca.qualcomm.com>2017-08-08 14:16:47 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2017-08-08 21:44:14 +0300
commit9b2a4c2d534ca45c74488bace32323b26633ff66 (patch)
tree2ae1466a168138fc1f746ab7f43539f435b18ce6 /drivers/net/wireless/ath/wil6210/pm.c
parentd1fbf07540b7d35df693e2e1d7528d8ca9bdb2c2 (diff)
wil6210: fix interface-up check
While wil_open is executed, any call to netif_running would return a success. In case there are failures within wil_open, should not treat the device as if it is already opened in relevant functions (like FW recovery and runtime suspend check). Fix that by checking the device up flag instead. Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/pm.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/pm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/pm.c b/drivers/net/wireless/ath/wil6210/pm.c
index 820ed17ae2d4..8f5d1b447aaa 100644
--- a/drivers/net/wireless/ath/wil6210/pm.c
+++ b/drivers/net/wireless/ath/wil6210/pm.c
@@ -21,10 +21,11 @@ int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime)
{
int rc = 0;
struct wireless_dev *wdev = wil->wdev;
+ struct net_device *ndev = wil_to_ndev(wil);
wil_dbg_pm(wil, "can_suspend: %s\n", is_runtime ? "runtime" : "system");
- if (!netif_running(wil_to_ndev(wil))) {
+ if (!(ndev->flags & IFF_UP)) {
/* can always sleep when down */
wil_dbg_pm(wil, "Interface is down\n");
goto out;