diff mbox series

i2c: axxia: disable clock after removing adapter in remove

Message ID tencent_C372A37EAC8803525A57CB890B30E0B7B105@qq.com
State New
Headers show
Series i2c: axxia: disable clock after removing adapter in remove | expand

Commit Message

Jiawen Liu Aug. 18, 2026, 12:41 p.m. UTC
From: jiawen <1298662399@qq.com>

In axxia_i2c_remove, the controller clock is disabled before
i2c_del_adapter is called. This leaves adapter teardown running after
the hardware clock is off, which can cause undefined behavior or hangs.

Reorder the calls to disable the clock after removing the adapter,
ensuring the adapter is fully torn down while the clock is still
enabled.

Signed-off-by: jiawen <1298662399@qq.com>
---
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -795,8 +795,8 @@ 
 {
 	struct axxia_i2c_dev *idev = platform_get_drvdata(pdev);
 
+	i2c_del_adapter(&idev->adapter);
 	clk_disable_unprepare(idev->i2c_clk);
-	i2c_del_adapter(&idev->adapter);
 }
 
 /* Match table for of_platform binding */