[PATCH] i2c: i2c-s3c2410: fix runtime PM cleanup

Jiawen Liu <[email protected]>
Newsgroups org.kernel.vger.linux-samsung-soc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-i2c,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Keep clock enabled until adapter teardown.

The remove path disables the controller clock before unregistering the
I2C adapter, so adapter teardown can run after the hardware clock has
already been turned off.

Move I2C teardown before clock release (pm_runtime_disable,
clk_unprepare) in s3c24xx_i2c_remove.

Signed-off-by: jiawen <[email protected]>
---
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1136,11 +1136,9 @@
 {
 	struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
 
+	i2c_del_adapter(&i2c->adap);
+	pm_runtime_disable(&pdev->dev);
 	clk_unprepare(i2c->clk);
-
-	pm_runtime_disable(&pdev->dev);
-
-	i2c_del_adapter(&i2c->adap);
 }
 
 static int s3c24xx_i2c_suspend_noirq(struct device *dev)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.