From patchwork Thu Oct 3 09:59:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 20767 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1FF4C25CAB for ; Thu, 3 Oct 2013 09:59:44 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf4207638qcv.3 for ; Thu, 03 Oct 2013 02:59:44 -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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=R/Sec06iTage5PaQg7nAhP53civAkPoi0LjU5O7LtU8=; b=MCdRK1EPA7eRvgCrnOVr4iSBj0MLCkjTrMXfgF9rmekxiHhy6vHi5CODkR28JuN2M9 Q5kviZbmK+GRAYjtJZ1R9LjmeVCVI00TUWmBS5aMM6k75pZ60yH+qlF49bBzAVG9lzAD Euub5fEjRCmP5ZomLaF00niTt/7oFvkUEqSpLVduAFBDd6Zf+AQywxIw5Mcr2bd261zh 83rRuiOUrbMQYBitTARaPHvxgJ9elncctFnS/neyeut8JeLPBWX/3wH9Zzsn7/iK0DLg 4cEtOQ3XQ5Z5AoFWmrscpB81XU/bdrmBMtRxPCRN6Aweg/jrlZ0sF5UwkjaqAjm14qFv j/xQ== X-Received: by 10.236.24.195 with SMTP id x43mr6379844yhx.3.1380794383965; Thu, 03 Oct 2013 02:59:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.225 with SMTP id f1ls797756qeo.66.gmail; Thu, 03 Oct 2013 02:59:43 -0700 (PDT) X-Received: by 10.52.65.136 with SMTP id x8mr5667494vds.23.1380794383855; Thu, 03 Oct 2013 02:59:43 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id tj1si1519785vdc.131.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:59:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so1513938veb.36 for ; Thu, 03 Oct 2013 02:59:43 -0700 (PDT) X-Gm-Message-State: ALoCoQko/viLtJPPtgerVus/iMOi/af0Yy0CzYygiEpZUpwWxn8XzcsMpCMGmuoVCbtzS6+xSNA7 X-Received: by 10.58.146.71 with SMTP id ta7mr625252veb.23.1380794383737; Thu, 03 Oct 2013 02:59:43 -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 u4csp165072vcz; Thu, 3 Oct 2013 02:59:43 -0700 (PDT) X-Received: by 10.15.98.9 with SMTP id bi9mr1815198eeb.67.1380794382527; Thu, 03 Oct 2013 02:59:42 -0700 (PDT) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by mx.google.com with ESMTPS id l42si5176267eef.88.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:59:42 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.52 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.83.52; Received: by mail-ee0-f52.google.com with SMTP id c41so955526eek.25 for ; Thu, 03 Oct 2013 02:59:41 -0700 (PDT) X-Received: by 10.14.218.197 with SMTP id k45mr11527310eep.32.1380794381847; Thu, 03 Oct 2013 02:59:41 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id f49sm13821180eec.7.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 02:59:41 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson Subject: [PATCH] mmc: core: Remove redundant mmc_power_up|off at runtime callbacks Date: Thu, 3 Oct 2013 11:59:38 +0200 Message-Id: <1380794378-4308-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.128.177 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 6d02012..f0dcc53 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1552,18 +1552,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; } @@ -1577,15 +1570,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 5e8823d..0f2a1f9 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1117,18 +1117,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; } @@ -1142,15 +1135,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; }