From b5d6e5f66304bddc2b5bc7222e993dfeb629ef0c Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Sun, 26 Jun 2011 18:00:11 +0300 Subject: [PATCH] wl12xx: one SDIO initialization is enough 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 Signed-off-by: Luciano Coelho --- drivers/net/wireless/wl12xx/sdio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c index 4dc4573b686..5cf18c2c23f 100644 --- a/drivers/net/wireless/wl12xx/sdio.c +++ b/drivers/net/wireless/wl12xx/sdio.c @@ -166,13 +166,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); @@ -188,7 +188,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; -- 2.11.4.GIT