Re: [PATCH v8 2/3] i2c: mux: Set adapter physical device
From: Peter Rosin
Date: Sat Jul 04 2026 - 05:42:15 EST
On 2026-06-30 12:30, Herve Codina wrote:
For i2c muxes, the parent of the mux adapter device is the adapter
device the mux is connected to.
This parent is not the physical device related to the mux adapter.
Indeed, the physical device of the mux adapter is the mux device itself.
Fill the adap.physdev with the mux device.
Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
---
drivers/i2c/i2c-mux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 681a201c239b..f4e73e7a0e33 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -315,6 +315,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
priv->adap.algo = &priv->algo;
priv->adap.algo_data = priv;
priv->adap.dev.parent = &parent->dev;
+ priv->adap.physdev = muxc->dev;
priv->adap.retries = parent->retries;
priv->adap.timeout = parent->timeout;
priv->adap.quirks = parent->quirks;
Given how similar the implementation details are for address translators
and muxes, I expect that this pattern is present there as well.
I.e. I think a line with "chan->adap.physdev = dev;" should be added to
the i2c_atr_add_adapter() function (in the obvious place).
Cheers,
Peter