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

From: Andrew Lunn <[email-masked]>
Date: Sat, 22 Jan 2022 00:48:59 +0100

> 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