net: dsa: loop: remove MDIO device modalias

This change is a prerequisite for removing the MDIO device modalias,
as dsa_loop is the only user. Switch from modalias to a custom
bus match function.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Tested-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/15a4318f-50b5-4df5-874e-e387ee070a9d@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Heiner Kallweit
2026-01-31 18:38:56 +01:00
committed by Paolo Abeni
parent f7aa2ef10c
commit 5fddafbb92

View File

@@ -395,6 +395,12 @@ static struct mdio_driver dsa_loop_drv = {
.shutdown = dsa_loop_drv_shutdown,
};
static int dsa_loop_bus_match(struct device *dev,
const struct device_driver *drv)
{
return drv == &dsa_loop_drv.mdiodrv.driver;
}
static void dsa_loop_phydevs_unregister(void)
{
for (int i = 0; i < NUM_FIXED_PHYS; i++) {
@@ -428,7 +434,7 @@ static int __init dsa_loop_create_switch_mdiodev(void)
if (IS_ERR(switch_mdiodev))
goto out;
strscpy(switch_mdiodev->modalias, "dsa-loop");
switch_mdiodev->bus_match = dsa_loop_bus_match;
switch_mdiodev->dev.platform_data = &dsa_loop_pdata;
ret = mdio_device_register(switch_mdiodev);