Skip to contentSkip to conversation

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

PATCH New Cong Nguyen 1 participant 1 message Nov 24

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

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")
---
 drivers/i2c/busses/i2c-omap.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/i2c/busses/i2c-omap.c +0 -3
index 4dd111f77ea0..d3c576ca7681 100644
@@ -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");
Signature · 1 line
2.25.1