Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256217
b: refs/heads/master
c: 86046da
h: refs/heads/master
i:
  256215: e7493ad
v: v3
  • Loading branch information
Ohad Ben-Cohen authored and Luciano Coelho committed Jun 27, 2011
1 parent 88eac48 commit c137efc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2c2bb9fccdfe3cb70b276ae69e53d4890b11871
refs/heads/master: 86046da4afe068991b77e0a4c4b79b99ad961bda
17 changes: 11 additions & 6 deletions trunk/drivers/net/wireless/wl12xx/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
struct sdio_func *func = wl_to_func(wl);
int ret;

/* Make sure the card will not be powered off by runtime PM */
ret = pm_runtime_get_sync(&func->dev);
if (ret < 0)
goto out;
/* If enabled, tell runtime PM not to power off the card */
if (pm_runtime_enabled(&func->dev)) {
ret = pm_runtime_get_sync(&func->dev);
if (ret)
goto out;
}

/* Runtime PM might be disabled, so power up the card manually */
ret = mmc_power_restore_host(func->card->host);
Expand All @@ -191,8 +193,11 @@ static int wl1271_sdio_power_off(struct wl1271 *wl)
if (ret < 0)
return ret;

/* Let runtime PM know the card is powered off */
return pm_runtime_put_sync(&func->dev);
/* If enabled, let runtime PM know the card is powered off */
if (pm_runtime_enabled(&func->dev))
ret = pm_runtime_put_sync(&func->dev);

return ret;
}

static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
Expand Down

0 comments on commit c137efc

Please sign in to comment.