Re: [PATCH v3 15/28] i2c: core: Introduce i2c_get_adapter_physdev()

From: Andi Shyti
Date: Tue Jul 22 2025 - 10:07:47 EST


Hi Herve,

On Fri, Jun 13, 2025 at 03:47:55PM +0200, Herve Codina wrote:
> The physical device providing an I2C adapter is the device that calls
> i2c_add_adapter() or variants and i2c_del_adapter().
>
> Most of the time this physical device is the parent of the adapter
> device.
>
> Exceptions exist with i2c muxes. Indeed, in case of i2c muxes, the
> parent of the mux adapter device points to the adapter device the mux is
> connected to instead of the physical of this mux adapter.
>
> Introduce i2c_get_adapter_physdev() and a new physdev field in the
> adapter structure in order to ease the adapter physical device
> retrieval.
>
> Signed-off-by: Herve Codina <herve.codina@xxxxxxxxxxx>

Makes sense to me,

Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>

Thanks,
Andi