public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] spi: sun4i: disable clocks in the remove function
@ 2017-12-06 15:22 Takuo Koguchi
  2017-12-06 15:20 ` Maxime Ripard
  0 siblings, 1 reply; 7+ messages in thread
From: Takuo Koguchi @ 2017-12-06 15:22 UTC (permalink / raw)
  To: linux-arm-kernel

mclk and hclk need to be disabled explicitly since pm_runtime_disable does
not disable the clocks.

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

Signed-off-by: Takuo Koguchi <takuo.koguchi.sw@hitachi.com>
---
 drivers/spi/spi-sun4i.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index c5cd635..9011c09 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -525,6 +525,11 @@ static int sun4i_spi_probe(struct platform_device *pdev)
 
 static int sun4i_spi_remove(struct platform_device *pdev)
 {
+	struct spi_master *master = dev_get_drvdata(&pdev->dev);
+	struct sun4i_spi *sspi = spi_master_get_devdata(master);
+
+	clk_disable_unprepare(sspi->mclk);
+	clk_disable_unprepare(sspi->hclk);
 	pm_runtime_disable(&pdev->dev);
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-07 12:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-06 15:22 [PATCH] spi: sun4i: disable clocks in the remove function Takuo Koguchi
2017-12-06 15:20 ` Maxime Ripard
2017-12-06 18:00   ` Takuo Koguchi
2017-12-07  7:20   ` [PATCH V3] " Takuo Koguchi
2017-12-07  9:18     ` Maxime Ripard
2017-12-07 11:58     ` Mark Brown
2017-12-07 12:35     ` Applied "spi: sun4i: disable clocks in the remove function" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox