Re: [PATCH net-next v4 05/11] net: dsa: realtek: use phy_read in ds->ops

Andrew Lunn
2022-01-21T23:49:05Z

> Should I submit a patch to make dsa work like this then?
>
> dsa_switch_setup() {
> ....
> ds->ops->setup()
> ....
> if (ds->ops->phy_read) {
> if (ds->slave_mii_bus)
> error("ds->ops->phy_read is set, I should be the
> one allocating ds->slave_mii_bus!")
> ...allocate and register ds->slave_mii_bus...
> }
> }

You could add a WARN_ON(ds->ops->phy_read && ds->ops->phy_read);

Andrew