]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: dsa: loop: remove MDIO device modalias
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 31 Jan 2026 17:38:56 +0000 (18:38 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Feb 2026 11:46:55 +0000 (12:46 +0100)
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>
drivers/net/dsa/dsa_loop.c

index 4a416f2717baee51e0560a0c5d40ececda4bfb19..b41254b3ac4251ba4baba320cb6821602f2d7cf5 100644 (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);