[PATCH v9 2/3] i2c: {mux,atr}: Set adapter physical device
From: Herve Codina
Date: Wed Nov 04 2026 - 08:55:07 EST
For i2c muxes and atrs (address translators), the parent of the mux/atr
adapter device is the adapter device the mux/atr is connected to.
This parent is not the physical device related to the mux/atr adapter.
Indeed, the physical device of the mux/atr adapter is the mux/atr device
itself.
Fill the adap.physdev with the mux/atr device.
Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>
Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
---
drivers/i2c/i2c-atr.c | 1 +
drivers/i2c/i2c-mux.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c
index b98442ffff94..a591d39050e7 100644
--- a/drivers/i2c/i2c-atr.c
+++ b/drivers/i2c/i2c-atr.c
@@ -824,6 +824,7 @@ int i2c_atr_add_adapter(struct i2c_atr *atr, struct i2c_atr_adap_desc *desc)
chan->adap.algo = &atr->algo;
chan->adap.algo_data = chan;
chan->adap.dev.parent = desc->parent;
+ chan->adap.physdev = dev;
chan->adap.retries = parent->retries;
chan->adap.timeout = parent->timeout;
chan->adap.quirks = parent->quirks;
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 53428098ddc7..c1836114ef56 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -361,6 +361,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;
--
2.56.0