On 08.09.23 15:04, Sascha Hauer wrote:
> On mdio busses the attached phys check for link status in a poller.
> Add a slice dependency from the mdio bus to the I2C/SPI controller
> so that we do not end up doing bus accesses while we are in a
> I2C/SPI access on the same bus already.
> 
> Signed-off-by: Sascha Hauer <[email protected]>
> ---
>  drivers/net/ksz9477.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ksz9477.c b/drivers/net/ksz9477.c
> index 9665e0f723..1abea9d040 100644
> --- a/drivers/net/ksz9477.c
> +++ b/drivers/net/ksz9477.c
> @@ -464,6 +464,13 @@ static int microchip_switch_probe(struct device *dev)
>       if (ret)
>               return ret;
>  
> +     if (priv->i2c)
> +             slice_depends_on(mdiobus_slice(ds->slave_mii_bus),
> +                              i2c_client_slice(priv->i2c));
> +     else
> +             slice_depends_on(mdiobus_slice(ds->slave_mii_bus),
> +                              spi_device_slice(priv->spi));

Is there no way to do this in the core?

> +
>       return regmap_multi_register_cdev(priv->regmap[0], priv->regmap[1],
>                                         priv->regmap[2], NULL);
>  }

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


Reply via email to