Re: [PATCH v2 3/3] net: ksz9477: Add mdio bus slice dependency to i2c/spi device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Am 08.09.2023 um 15:11 schrieb Sascha Hauer:
> 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 <s.hauer@xxxxxxxxxxxxxx>

Tested-by: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx>

> ---
>  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));
> +
>  	return regmap_multi_register_cdev(priv->regmap[0], priv->regmap[1],
>  					  priv->regmap[2], NULL);
>  }




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux