Commit e85d1629 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: configure suspend/resume only if associated/started

Configure the device (to wowlan) only if the sta/ap
is associated/started.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent b5d6e5f6
......@@ -1610,10 +1610,13 @@ static struct notifier_block wl1271_dev_notifier = {
#ifdef CONFIG_PM
static int wl1271_configure_suspend_sta(struct wl1271 *wl)
{
int ret;
int ret = 0;
mutex_lock(&wl->mutex);
if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
goto out_unlock;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;
......@@ -1658,10 +1661,13 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl)
static int wl1271_configure_suspend_ap(struct wl1271 *wl)
{
int ret;
int ret = 0;
mutex_lock(&wl->mutex);
if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags))
goto out_unlock;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;
......
Markdown is supported
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