* [PATCH] wl12xx: one SDIO initialization is enough
@ 2011-06-26 15:00 Ohad Ben-Cohen
2011-07-05 19:06 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: Ohad Ben-Cohen @ 2011-06-26 15:00 UTC (permalink / raw)
To: linux-wireless; +Cc: Luciano Coelho, Ohad Ben-Cohen
Skip manual device power on in case runtime PM is enabled for
our device.
This eliminates a secondary & redundant SDIO init sequence.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
---
This patch depends on "wl12xx: don't bail if mmc isn't MMC_CAP_POWER_OFF_CARD"
https://patchwork.kernel.org/patch/827772/
drivers/net/wireless/wl12xx/sdio.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 989b077..886c35f 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -174,13 +174,13 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
ret = pm_runtime_get_sync(&func->dev);
if (ret)
goto out;
+ } else {
+ /* Runtime PM is disabled: power up the card manually */
+ ret = mmc_power_restore_host(func->card->host);
+ if (ret < 0)
+ goto out;
}
- /* Runtime PM might be disabled, so power up the card manually */
- ret = mmc_power_restore_host(func->card->host);
- if (ret < 0)
- goto out;
-
sdio_claim_host(func);
sdio_enable_func(func);
@@ -196,7 +196,7 @@ static int wl1271_sdio_power_off(struct wl1271 *wl)
sdio_disable_func(func);
sdio_release_host(func);
- /* Runtime PM might be disabled, so power off the card manually */
+ /* Power off the card manually, even if runtime PM is enabled. */
ret = mmc_power_save_host(func->card->host);
if (ret < 0)
return ret;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-05 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-26 15:00 [PATCH] wl12xx: one SDIO initialization is enough Ohad Ben-Cohen
2011-07-05 19:06 ` Luciano Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox