public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Flavio Ceolin <flavio.ceolin@intel.com>
To: linux-kernel@vger.kernel.org
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	"open list:SECURE DIGITAL HOST CONTROLLER INTERFACE SDHCI..."
	<linux-mmc@vger.kernel.org>,
	Michal Simek <michal.simek@xilinx.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Flavio Ceolin <flavio.ceolin@intel.com>,
	"moderated list:ARM/ZYNQ ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH] mmc: sdhci-of-arasan: Disable clk_xin clock in the remove
Date: Tue, 12 Dec 2017 00:19:55 -0800	[thread overview]
Message-ID: <20171212081955.2309-1-flavio.ceolin@intel.com> (raw)

clk_xin is properly prepared/enabled on sdhci_arasan_probe(), and
unprepared/disabled in the error path, but it is not being
unprepared/disabled on sdhci_arasan_remove().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 0720ea7..69bd260 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -692,6 +692,7 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
 	struct clk *clk_ahb = sdhci_arasan->clk_ahb;
+	struct clk *clk_xin = devm_clk_get(&pdev->dev, "clk_xin");
 
 	if (!IS_ERR(sdhci_arasan->phy)) {
 		if (sdhci_arasan->is_phy_on)
@@ -705,6 +706,9 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(clk_ahb);
 
+	if (!IS_ERR(clk_xin))
+		clk_disable_unprepare(clk_xin);
+
 	return ret;
 }
 
-- 
2.9.5

             reply	other threads:[~2017-12-12  8:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12  8:19 Flavio Ceolin [this message]
2017-12-12  9:37 ` [PATCH] mmc: sdhci-of-arasan: Disable clk_xin clock in the remove Michal Simek
2017-12-12 17:15   ` Flavio Ceolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171212081955.2309-1-flavio.ceolin@intel.com \
    --to=flavio.ceolin@intel.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox