aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2015-01-30 08:35:22 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-02-03 08:30:55 -0500
commit13084c2d18bfee72594ba3a969dfdd972544e644 (patch)
tree335886ad0d535862bec1f7306b294cfcf9355f23 /drivers/net/wireless/ath
parent4895efc9a11ba6a3089b42c5dd4aabf68e467d64 (diff)
ath9k: Return early for error conditions
Do not try to cancel work instances and ANI when the device is not present or WOW triggers are not configured. Bail out early and use ath_err() for such error conditions. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/wow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/wow.c b/drivers/net/wireless/ath/ath9k/wow.c
index 4ffaadd167a8..1d5cd88783bd 100644
--- a/drivers/net/wireless/ath/ath9k/wow.c
+++ b/drivers/net/wireless/ath/ath9k/wow.c
@@ -197,21 +197,21 @@ int ath9k_suspend(struct ieee80211_hw *hw,
197 197
198 mutex_lock(&sc->mutex); 198 mutex_lock(&sc->mutex);
199 199
200 ath_cancel_work(sc);
201 ath_stop_ani(sc);
202
203 if (test_bit(ATH_OP_INVALID, &common->op_flags)) { 200 if (test_bit(ATH_OP_INVALID, &common->op_flags)) {
204 ath_dbg(common, ANY, "Device not present\n"); 201 ath_err(common, "Device not present\n");
205 ret = -EINVAL; 202 ret = -ENODEV;
206 goto fail_wow; 203 goto fail_wow;
207 } 204 }
208 205
209 if (WARN_ON(!wowlan)) { 206 if (WARN_ON(!wowlan)) {
210 ath_dbg(common, WOW, "None of the WoW triggers enabled\n"); 207 ath_err(common, "None of the WoW triggers enabled\n");
211 ret = -EINVAL; 208 ret = -EINVAL;
212 goto fail_wow; 209 goto fail_wow;
213 } 210 }
214 211
212 ath_cancel_work(sc);
213 ath_stop_ani(sc);
214
215 if (!device_can_wakeup(sc->dev)) { 215 if (!device_can_wakeup(sc->dev)) {
216 ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n"); 216 ath_dbg(common, WOW, "device_can_wakeup failed, WoW is not enabled\n");
217 ret = 1; 217 ret = 1;