[PATCH] i2c: microchip-corei2c: disable clock after removing adapter

Jiawen Liu 1298662399 at qq.com
Tue Aug 18 05:41:15 PDT 2026


From: jiawen <1298662399 at qq.com>

In mchp_corei2c_remove(), the controller clock is disabled before
i2c_del_adapter() is called. This leaves the adapter teardown running
without the controller clock, which may be required for proper
operation. Reorder the calls to disable the clock after removing the
adapter, ensuring the adapter teardown runs while the clock is
available.

Signed-off-by: jiawen <1298662399 at qq.com>
---
diff --git a/drivers/i2c/busses/i2c-microchip-corei2c.c b/drivers/i2c/busses/i2c-microchip-corei2c.c
--- a/drivers/i2c/busses/i2c-microchip-corei2c.c
+++ b/drivers/i2c/busses/i2c-microchip-corei2c.c
@@ -621,8 +621,8 @@
 {
 	struct mchp_corei2c_dev *idev = platform_get_drvdata(pdev);
 
+	i2c_del_adapter(&idev->adapter);
 	clk_disable_unprepare(idev->i2c_clk);
-	i2c_del_adapter(&idev->adapter);
 }
 
 static const struct of_device_id mchp_corei2c_of_match[] = {




More information about the linux-riscv mailing list