Re: [PATCH net-next v4 05/11] net: dsa: realtek: use phy_read in ds->ops
From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-01-21 23:49:05
From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-01-21 23:49:05
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