On 1/21/25 3:38 PM, Paul Barker wrote:
On 18/01/2025 06:53, Marek Vasut wrote:
Introduce mdio_init() split off from mdio_alloc(), which is used
to initialize already allocated struct mii_dev.
Signed-off-by: Marek Vasut <marek.vasut+rene...@mailbox.org>
Replying here for the whole patch series...
I like where we get to at the end of this series, but I don't like the
intermediate state where the bb_miiphy_buses arrays still exist but are
unused. I also think we should introduce a new ops struct so we're not
duplicating function pointers in each instance of struct bb_miiphy_bus.
I would prefer the following order of changes, let me know if you think
this would be cleaner:
1) Introduce mdio_init().
2) Add mii member to struct bb_miiphy_bus.
3) Modify each driver to use the mii member of the appropriate struct
bb_miiphy_bus instance, calling mdio_init() instead of mdio_alloc().
At this point we're still using the instances in the statically
allocated bb_miiphy_buses array.
Those instances might be rodata , so using them as read-write storage
does not necessarily work , does it ?
--
Best regards,
Marek Vasut