[PATCH 0/4] i2c: muxes: pca954x: bug fixes and cleanups

From: Pradhan, Sanman

Date: Wed Apr 15 2026 - 13:07:58 EST


From: Sanman Pradhan <psanman@xxxxxxxxxxx>

This series addresses two bug fixes and two cleanups in the pca954x
I2C mux driver.

Patches 1-2 fix resource lifecycle issues in pca954x_cleanup():

- Patch 1 reorders cleanup so that child adapters are removed before
the regulator is disabled, ensuring children are torn down while
the device is still powered.

- Patch 2 quiesces the parent IRQ via devm_free_irq() before removing
child adapters and tearing down the IRQ domain. The threaded handler
dispatches nested child IRQs over the mux, so it must be stopped
before either child adapters or the IRQ domain are dismantled.
Because pca954x_cleanup() is also used as the probe error-unwind
path and the IRQ domain is created before the parent IRQ is
requested, a flag guards the devm_free_irq() call so it is only
issued when the managed IRQ was actually registered.

Patches 3-4 are straightforward cleanups:

- Patch 3 replaces sprintf() with sysfs_emit() in idle_state_show().
- Patch 4 marks pca954x_irq_chip as const with IRQCHIP_IMMUTABLE.

Sanman Pradhan (4):
i2c: muxes: pca954x: fix cleanup ordering in pca954x_cleanup()
i2c: muxes: pca954x: free parent IRQ before dismantling IRQ domain
i2c: muxes: pca954x: use sysfs_emit() in idle_state_show()
i2c: muxes: pca954x: mark irq_chip as immutable

drivers/i2c/muxes/i2c-mux-pca954x.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

--
2.34.1