]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: mdio: pull bus/ctrl dependency apart
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Wed, 25 Mar 2026 13:48:43 +0000 (14:48 +0100)
committerRobert Marko <robimarko@gmail.com>
Fri, 27 Mar 2026 19:51:43 +0000 (20:51 +0100)
commit6069fe9ae17ccfe469135cd3b9e1fbcefe04f208
treeb131a1e7e5741e0af9e607cb4718afc14c4662f9
parent0d195bfce3d97e61738cb0477097dd4f819c5e35
realtek: mdio: pull bus/ctrl dependency apart

Until now the central control structure is allocated via a call to
devm_mdiobus_alloc_size(). This will not be possible any longer when
multiple busses will be implemented in a future commit.

Relax that as follows:

- Define a new private "channel" structure for a mdio bus
- Allocate the central control structure with a dedicated alloc()
- Allocate only the channel structure during bus setup
- Link the channel to the central structure via chan->ctrl

Reorganize the probing function so that it becomes clearer that
the control structure is setup first and afterwards the bus is
registered.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22604
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c