summaryrefslogtreecommitdiff
path: root/drivers/net/phy/mdio_bus.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2023-01-18 11:01:38 +0100
committerPaolo Abeni <pabeni@redhat.com>2023-01-19 16:23:19 +0100
commit1a136ca2e089d91df8eec0a796a324171373ffd8 (patch)
tree2dda64086f24700912d444a26f9a74e3b8b1710c /drivers/net/phy/mdio_bus.c
parent3486593374858b41ae6ef7720cb28ff39ad822f3 (diff)
net: mdio: scan bus based on bus capabilities for C22 and C45
Now that all MDIO bus drivers which set probe_capabilities to MDIOBUS_C22_C45 have been converted to use the name API for C45 transactions, perform the scanning of the bus based on which methods the bus provides. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/phy/mdio_bus.c')
-rw-r--r--drivers/net/phy/mdio_bus.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index a664eeb1868d..5b2f48c09a6a 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -711,9 +711,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
goto error_reset_gpiod;
}
- if (bus->probe_capabilities == MDIOBUS_NO_CAP ||
- bus->probe_capabilities == MDIOBUS_C22 ||
- bus->probe_capabilities == MDIOBUS_C22_C45) {
+ if (bus->read) {
err = mdiobus_scan_bus_c22(bus);
if (err)
goto error;
@@ -721,9 +719,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
prevent_c45_scan = mdiobus_prevent_c45_scan(bus);
- if (!prevent_c45_scan &&
- (bus->probe_capabilities == MDIOBUS_C45 ||
- bus->probe_capabilities == MDIOBUS_C22_C45)) {
+ if (!prevent_c45_scan && bus->read_c45) {
err = mdiobus_scan_bus_c45(bus);
if (err)
goto error;