Skip to content

Commit

Permalink
wl1251: simplify ELP wakeup time calculation
Browse files Browse the repository at this point in the history
The wakeup time calculation was too complicated, simplify it.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Kalle Valo authored and John W. Linville committed Dec 21, 2009
1 parent b5a1679 commit 7fa6282
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/wireless/wl12xx/wl1251_ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl)

int wl1251_ps_elp_wakeup(struct wl1251 *wl)
{
unsigned long timeout;
unsigned long timeout, start;
u32 elp_reg;

if (!wl->elp)
return 0;

wl1251_debug(DEBUG_PSM, "waking up chip from elp");

start = jiffies;
timeout = jiffies + msecs_to_jiffies(WL1251_WAKEUP_TIMEOUT);

wl1251_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, ELPCTRL_WAKE_UP);
Expand All @@ -96,8 +97,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl)
}

wl1251_debug(DEBUG_PSM, "wakeup time: %u ms",
jiffies_to_msecs(jiffies) -
(jiffies_to_msecs(timeout) - WL1251_WAKEUP_TIMEOUT));
jiffies_to_msecs(jiffies - start));

wl->elp = false;

Expand Down

0 comments on commit 7fa6282

Please sign in to comment.