From patchwork Fri Oct 11 12:28:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 20965 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5323025EA1 for ; Fri, 11 Oct 2013 12:28:46 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf7134614iej.4 for ; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=XDoW3GcnBVYIxIhSBfwlzubRrZuhkbk+uX5lqI6cRU8=; b=GH6ztvH2hMbRA0OR2czwCsm8pHcIDhuheW1lrqvjD7evmRBVw0aco7h4du1H6nVF9Y ALVrYX5Ulm+G3zCavRno7ZXtip6CpBmJzWGvqhfqq5k/I/lPXPy2/rOyypGziofOZOhT q0XSnrEBkFrMPRHaS7Gd6WxoX4oHARAZBQmHbyGBT+ZKKx9CPQlPKN6aKB7HhQRx2IOE A42t+L8U+K3+q6EvSyw+I0IpjeWCWiqbE+D8PRNHuNVLGvKVGLYk0bq/aZzvAWojNbA/ qj9uIAAsshzm+ATj31b0Sj+2rNCLe0jV+rs23y9ORyaZ5X0ZI4inBdkVKA1rEK/gg7qc nnKg== X-Received: by 10.182.105.227 with SMTP id gp3mr6283858obb.23.1381494525789; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.51.169 with SMTP id l9ls1408774qeo.97.gmail; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) X-Received: by 10.52.35.20 with SMTP id d20mr14415281vdj.33.1381494525646; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id gw1si16580389vcb.137.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:28:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so2714786vbg.15 for ; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) X-Gm-Message-State: ALoCoQk1IX7mt2AnB5e0wi9HRAtZBZM3smep5mWj1zDmeDA5SmXHKKahzMjxLrRMSmKAlSbeH3po X-Received: by 10.52.231.5 with SMTP id tc5mr987011vdc.36.1381494525558; Fri, 11 Oct 2013 05:28:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp35311vcz; Fri, 11 Oct 2013 05:28:44 -0700 (PDT) X-Received: by 10.152.27.67 with SMTP id r3mr724051lag.50.1381494523964; Fri, 11 Oct 2013 05:28:43 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id g2si21993934laa.167.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:28:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.180 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id q8so3380040lbi.11 for ; Fri, 11 Oct 2013 05:28:43 -0700 (PDT) X-Received: by 10.152.5.162 with SMTP id t2mr16041897lat.1.1381494523274; Fri, 11 Oct 2013 05:28:43 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id l10sm33275873lbh.13.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Oct 2013 05:28:42 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: "Rafael J. Wysocki" , Kevin Hilman , Alan Stern , Colin Cross , Android Kernel Team , John Stultz , Ulf Hansson Subject: [PATCH 2/4] mmc: core: Remove redundant mmc_power_up|off at runtime callbacks Date: Fri, 11 Oct 2013 14:28:16 +0200 Message-Id: <1381494498-16699-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381494498-16699-1-git-send-email-ulf.hansson@linaro.org> References: <1381494498-16699-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit "mmc: core: Push common suspend|resume code into each bus_ops" moved the responsibility for doing mmc_power_up|off into each suspend/resume bus_ops. When using MMC_CAP_AGGRESSIVE_PM, through the runtime callbacks, calls to mmc_power_up|off became redundant. When removing them, we are also able to remove the calls to mmc_claim|release_host, thus simplifing code a bit more. Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc.c | 13 +------------ drivers/mmc/core/sd.c | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index f7722d2..907f0a0 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1575,18 +1575,11 @@ static int mmc_runtime_suspend(struct mmc_host *host) if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) return 0; - mmc_claim_host(host); - err = mmc_suspend(host); - if (err) { + if (err) pr_err("%s: error %d doing aggessive suspend\n", mmc_hostname(host), err); - goto out; - } - mmc_power_off(host); -out: - mmc_release_host(host); return err; } @@ -1600,15 +1593,11 @@ static int mmc_runtime_resume(struct mmc_host *host) if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) return 0; - mmc_claim_host(host); - - mmc_power_up(host); err = mmc_resume(host); if (err) pr_err("%s: error %d doing aggessive resume\n", mmc_hostname(host), err); - mmc_release_host(host); return 0; } diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index ef302f3..2287ceb 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1130,18 +1130,11 @@ static int mmc_sd_runtime_suspend(struct mmc_host *host) if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) return 0; - mmc_claim_host(host); - err = mmc_sd_suspend(host); - if (err) { + if (err) pr_err("%s: error %d doing aggessive suspend\n", mmc_hostname(host), err); - goto out; - } - mmc_power_off(host); -out: - mmc_release_host(host); return err; } @@ -1155,15 +1148,11 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) return 0; - mmc_claim_host(host); - - mmc_power_up(host); err = mmc_sd_resume(host); if (err) pr_err("%s: error %d doing aggessive resume\n", mmc_hostname(host), err); - mmc_release_host(host); return 0; }