[PATCH] i2c: omap: do not deselect the mux-state twice in remove()

From: Cong Nguyen

Date: Tue Nov 24 2026 - 04:22:16 EST


omap_i2c_probe() gets the mux-state with
devm_mux_state_get_optional_selected(). The helper selects the mux and
deselects it again when the device is released.

omap_i2c_remove() also calls mux_state_deselect(), so the mux is
deselected twice for one select. Drop the call from remove().

This issue was found by auditing the driver with an LLM coding assistant.

Fixes: 43c00f2bcff7 ("i2c: omap: switch to new generic helper for getting selected mux-state")
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/i2c/busses/i2c-omap.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 4dd111f77ea0..d3c576ca7681 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1520,9 +1520,6 @@ static void omap_i2c_remove(struct platform_device *pdev)

i2c_del_adapter(&omap->adapter);

- if (omap->mux_state)
- mux_state_deselect(omap->mux_state);
-
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
dev_err(omap->dev, "Failed to resume hardware, skip disable\n");
--
2.25.1