diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2024-01-04 16:00:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-05 11:56:35 +0000 |
commit | cd4ba3ecced904cc8e48cde9ae3216889d139789 (patch) | |
tree | 953071c8c1b9c477599afa624b425ced7511f189 /drivers/ssb/host_soc.c | |
parent | fc74b32b4032fc1aba8fc92f0e17e5ebe773bb68 (diff) | |
download | lwn-cd4ba3ecced904cc8e48cde9ae3216889d139789.tar.gz lwn-cd4ba3ecced904cc8e48cde9ae3216889d139789.zip |
net: dsa: lantiq_gswip: use devres for internal MDIO bus, not ds->user_mii_bus
This driver does not need any of the functionalities that make
ds->user_mii_bus special. Those use cases are listed here:
https://lore.kernel.org/netdev/20231221174746.hylsmr3f7g5byrsi@skbuf/
It just makes use of ds->user_mii_bus only as storage for its own MDIO
bus, which otherwise has no connection to the framework. This is because:
- the gswip driver only probes on OF: it fails if of_device_get_match_data()
returns NULL
- when the child OF node of the MDIO bus is absent, no MDIO bus is
registered at all, not even by the DSA framework. In order for that to
have happened, the gswip driver would have needed to provide
->phy_read() and ->phy_write() in struct dsa_switch_ops, which it does
not.
We can break the connection between the gswip driver and the DSA
framework and still preserve the same functionality.
Since commit 3b73a7b8ec38 ("net: mdio_bus: add refcounting for fwnodes
to mdiobus"), MDIO buses take ownership of the OF node handled to them,
and release it on their own. The gswip driver no longer needs to do
this.
Combine that with devres, and we no longer need to keep track of
anything for teardown purposes.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ssb/host_soc.c')
0 files changed, 0 insertions, 0 deletions