[PATCH] i2c: microchip-corei2c: disable clock after removing adapter
From: Jiawen Liu
Date: Tue Aug 18 2026 - 08:46:23 EST
From: jiawen <1298662399@xxxxxx>
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@xxxxxx>
---
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[] = {