From patchwork Tue Mar 29 07:31:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 64575 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1853920lbc; Tue, 29 Mar 2016 00:31:27 -0700 (PDT) X-Received: by 10.112.17.70 with SMTP id m6mr384988lbd.142.1459236685910; Tue, 29 Mar 2016 00:31:25 -0700 (PDT) Return-Path: Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a]) by mx.google.com with ESMTPS id jm5si16143269lbc.1.2016.03.29.00.31.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Mar 2016 00:31:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org Received: by mail-lb0-x22a.google.com with SMTP id vo2so4699975lbb.1 for ; Tue, 29 Mar 2016 00:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0e03gj3F2y9rasRGlygHDhnfEjJ7k6Mv2ksA0+FmXms=; b=IoFBXTWVxFNpjxx6zvfW0/OsS42zcCy4I05qurPY3XoW3UAaEO5qc3IM398AIrdaXi 2n+2o3qR7EUS8Qz2PC6uEX3S2KoM3KNPS1uoiAjkzldASjC8ds/GfwBtCapIBTUHeQUm CNXoa0n+THy5pzPGkgGZH0sJA0A5f+QJeHdoE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0e03gj3F2y9rasRGlygHDhnfEjJ7k6Mv2ksA0+FmXms=; b=nMpRVFqZkJRyAWQL5jvTwo8FTPMbMh77LJLnvlsTvNzYaF2FUqWdO5ENUSTSopQPXk HnELFqmsAdcKKnyaUBrVhtq7bVMUhZV4acxLPhykO2GMnQfx5WffynYVaIZUYLbWfx+j iVNdA+JsjLRC8cPnSA4bQqqB9n4B/ges1aQQgZDIiRWn/fU8dLgSylwqs+vOcO3/ZNYr 3shNRmbYv2C3ygopLBIXyv22ucz6pZ9hAiSzpGLCjpCHox0ZnQ69w5Do107Xwtz+qMLl qEcxjD6Sju8nKTMnWK7ycKuNv/vovU0nw1Q+QKkfDrbc0Y6xj7k9X6keam1oaME/4z/2 BgTQ== X-Gm-Message-State: AD7BkJKrZ3XOG9xiBFGkGiXCX63wEGVIw5hhMioc5W1huQVzIvrVEH7ujDVHTC1F8X36hRD0URg= X-Received: by 10.112.136.201 with SMTP id qc9mr379886lbb.35.1459236685473; Tue, 29 Mar 2016 00:31:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-83-233-167-104.cust.bredband2.com. [83.233.167.104]) by smtp.gmail.com with ESMTPSA id qh4sm5033100lbb.43.2016.03.29.00.31.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2016 00:31:24 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Chaotian Jing Subject: [PATCH 3/8] mmc: mediatek: Remove redundant runtime PM calls Date: Tue, 29 Mar 2016 09:31:08 +0200 Message-Id: <1459236673-5639-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459236673-5639-1-git-send-email-ulf.hansson@linaro.org> References: <1459236673-5639-1-git-send-email-ulf.hansson@linaro.org> Commit 9250aea76bfc ("mmc: core: Enable runtime PM management of host devices"), made some calls to the runtime PM API from the driver redundant. Especially those which deals with runtime PM reference counting, so let's remove them. Cc: Chaotian Jing Signed-off-by: Ulf Hansson --- drivers/mmc/host/mtk-sd.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index b17f30d..5642f71 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -736,9 +736,6 @@ static void msdc_request_done(struct msdc_host *host, struct mmc_request *mrq) if (mrq->data) msdc_unprepare_data(host, mrq); mmc_request_done(host->mmc, mrq); - - pm_runtime_mark_last_busy(host->dev); - pm_runtime_put_autosuspend(host->dev); } /* returns true if command is fully handled; returns false otherwise */ @@ -886,8 +883,6 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq) WARN_ON(host->mrq); host->mrq = mrq; - pm_runtime_get_sync(host->dev); - if (mrq->data) msdc_prepare_data(host, mrq); @@ -1201,8 +1196,6 @@ static void msdc_ops_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) struct msdc_host *host = mmc_priv(mmc); int ret; - pm_runtime_get_sync(host->dev); - msdc_set_buswidth(host, ios->bus_width); /* Suspend/Resume will do power off/on */ @@ -1214,7 +1207,7 @@ static void msdc_ops_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ios->vdd); if (ret) { dev_err(host->dev, "Failed to set vmmc power!\n"); - goto end; + return; } } break; @@ -1242,10 +1235,6 @@ static void msdc_ops_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (host->mclk != ios->clock || host->timing != ios->timing) msdc_set_mclk(host, ios->timing, ios->clock); - -end: - pm_runtime_mark_last_busy(host->dev); - pm_runtime_put_autosuspend(host->dev); } static u32 test_delay_bit(u32 delay, u32 bit) @@ -1408,19 +1397,15 @@ static int msdc_execute_tuning(struct mmc_host *mmc, u32 opcode) struct msdc_host *host = mmc_priv(mmc); int ret; - pm_runtime_get_sync(host->dev); ret = msdc_tune_response(mmc, opcode); if (ret == -EIO) { dev_err(host->dev, "Tune response fail!\n"); - goto out; + return ret; } ret = msdc_tune_data(mmc, opcode); if (ret == -EIO) dev_err(host->dev, "Tune data fail!\n"); -out: - pm_runtime_mark_last_busy(host->dev); - pm_runtime_put_autosuspend(host->dev); return ret; }