From 3051419f3d1a8f694e3eaec3d54153bc243231a9 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Sat, 31 Jan 2026 18:40:00 +0100 Subject: [PATCH] net: phy: remove modalias-based mdio bus matching Last user dsa_loop has been migrated away from modalias-based matching, so we can remove this feature now. It was the only user of MDIO_NAME_SIZE, so remove also this constant. Signed-off-by: Heiner Kallweit Link: https://patch.msgid.link/ce1c6df0-4785-4b28-8322-32dc6bceea18@gmail.com Signed-off-by: Paolo Abeni --- drivers/net/phy/mdio_device.c | 13 ------------- include/linux/mdio.h | 1 - include/linux/mod_devicetable.h | 1 - 3 files changed, 15 deletions(-) diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index 6e90ed42cd98f..65636070a2228 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -36,18 +36,6 @@ static void mdio_device_release(struct device *dev) kfree(to_mdio_device(dev)); } -static int mdio_device_bus_match(struct device *dev, - const struct device_driver *drv) -{ - struct mdio_device *mdiodev = to_mdio_device(dev); - const struct mdio_driver *mdiodrv = to_mdio_driver(drv); - - if (mdiodrv->mdiodrv.flags & MDIO_DEVICE_IS_PHY) - return 0; - - return strcmp(mdiodev->modalias, drv->name) == 0; -} - struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr) { struct mdio_device *mdiodev; @@ -60,7 +48,6 @@ struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr) mdiodev->dev.release = mdio_device_release; mdiodev->dev.parent = &bus->dev; mdiodev->dev.bus = &mdio_bus_type; - mdiodev->bus_match = mdio_device_bus_match; mdiodev->device_free = mdio_device_free; mdiodev->device_remove = mdio_device_remove; mdiodev->bus = bus; diff --git a/include/linux/mdio.h b/include/linux/mdio.h index 42d6d47e445b7..7ad7ce48f5313 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -29,7 +29,6 @@ struct mdio_device { struct device dev; struct mii_bus *bus; - char modalias[MDIO_NAME_SIZE]; int (*bus_match)(struct device *dev, const struct device_driver *drv); void (*device_free)(struct mdio_device *mdiodev); diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 24eb5a88a5c58..5b1725fe97076 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -609,7 +609,6 @@ struct platform_device_id { kernel_ulong_t driver_data; }; -#define MDIO_NAME_SIZE 32 #define MDIO_MODULE_PREFIX "mdio:" #define MDIO_ID_FMT "%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u" -- 2.47.3