[PATCH v6 2/5] i2c: mux: add support for per channel bus frequency

Peter Rosin peda at axentia.se
Mon Feb 16 08:40:37 PST 2026


Hi!

> +static struct i2c_mux_core *i2c_mux_first_mux_locked(struct i2c_adapter *adap)
> +{
> +	struct i2c_adapter *parent;
> +
> +	while ((parent = i2c_parent_is_i2c_adapter(adap)) != NULL) {
> +		struct i2c_mux_priv *priv = adap->algo_data;

This assumption does not hold, making the cast pretty wild indeed. There
are other i2c_adapters with a parent besides muxes. See e.g. i2c_atr.c

Cheers,
Peter

> +
> +		if (priv && priv->muxc && priv->muxc->mux_locked)
> +			return priv->muxc;
> +
> +		adap = parent;
> +	}
> +
> +	return NULL;
> +}



More information about the linux-arm-kernel mailing list