* [PATCH] i2c: omap: do not deselect the mux-state twice in remove()
@ 2026-11-24 9:22 Cong Nguyen
2026-11-26 22:52 ` Andi Shyti
0 siblings, 1 reply; 2+ messages in thread
From: Cong Nguyen @ 2026-11-24 9:22 UTC (permalink / raw)
To: Vignesh R, Andi Shyti, Aaro Koskinen, Andreas Kemnade,
Kevin Hilman, Roger Quadros, Tony Lindgren
Cc: Josua Mayer, linux-omap, linux-i2c, linux-kernel
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@gmail.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: omap: do not deselect the mux-state twice in remove()
2026-11-24 9:22 [PATCH] i2c: omap: do not deselect the mux-state twice in remove() Cong Nguyen
@ 2026-11-26 22:52 ` Andi Shyti
0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2026-11-26 22:52 UTC (permalink / raw)
To: Cong Nguyen
Cc: Vignesh R, Aaro Koskinen, Andreas Kemnade, Kevin Hilman,
Roger Quadros, Tony Lindgren, Josua Mayer, linux-omap, linux-i2c,
linux-kernel
Hi Cong,
On Tue, Nov 24, 2026 at 04:22:02PM +0700, Cong Nguyen wrote:
> 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@gmail.com>
pushed to i2c/i2c-fixes.
Thanks,
Andi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-26 22:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 9:22 [PATCH] i2c: omap: do not deselect the mux-state twice in remove() Cong Nguyen
2026-11-26 22:52 ` Andi Shyti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®