From patchwork Sun Jun 26 15:00:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 919142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5QF0xsP018584 for ; Sun, 26 Jun 2011 15:00:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753825Ab1FZPAy (ORCPT ); Sun, 26 Jun 2011 11:00:54 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:33692 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336Ab1FZPAw (ORCPT ); Sun, 26 Jun 2011 11:00:52 -0400 Received: by wyg8 with SMTP id 8so642375wyg.19 for ; Sun, 26 Jun 2011 08:00:51 -0700 (PDT) Received: by 10.227.55.146 with SMTP id u18mr4729738wbg.25.1309100449118; Sun, 26 Jun 2011 08:00:49 -0700 (PDT) Received: from localhost.localdomain (93-172-33-137.bb.netvision.net.il [93.172.33.137]) by mx.google.com with ESMTPS id fd16sm958489wbb.20.2011.06.26.08.00.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 26 Jun 2011 08:00:48 -0700 (PDT) From: Ohad Ben-Cohen To: Cc: Luciano Coelho , Ohad Ben-Cohen Subject: [PATCH] wl12xx: one SDIO initialization is enough Date: Sun, 26 Jun 2011 18:00:11 +0300 Message-Id: <1309100411-15353-1-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 26 Jun 2011 15:00:59 +0000 (UTC) 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 --- 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;