public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching
@ 2026-01-31 17:36 Heiner Kallweit
  2026-01-31 17:37 ` [PATCH net-next 1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer Heiner Kallweit
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heiner Kallweit @ 2026-01-31 17:36 UTC (permalink / raw)
  To: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, David Miller, Simon Horman,
	Michael Hennerich, Alexandru Tachici, Vladimir Oltean
  Cc: netdev@vger.kernel.org

modalias-based MDIO device bus matching has only one user (dsa-loop),
where we can replace modalias-based matching with a simple custom
match function. This, and first patch of the series, lay the foundation
for removing modalias-based matching.

Heiner Kallweit (3):
  net: ethernet: adi: make name member of struct adin1110_cfg a pointer
  net: dsa: loop: remove MDIO device modalias
  net: phy: remove modalias-based mdio bus matching

 drivers/net/dsa/dsa_loop.c          |  8 +++++++-
 drivers/net/ethernet/adi/adin1110.c |  2 +-
 drivers/net/phy/mdio_device.c       | 13 -------------
 include/linux/mdio.h                |  1 -
 include/linux/mod_devicetable.h     |  1 -
 5 files changed, 8 insertions(+), 17 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next 1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer
  2026-01-31 17:36 [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching Heiner Kallweit
@ 2026-01-31 17:37 ` Heiner Kallweit
  2026-01-31 17:38 ` [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias Heiner Kallweit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2026-01-31 17:37 UTC (permalink / raw)
  To: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, David Miller, Simon Horman,
	Michael Hennerich, Alexandru Tachici, Vladimir Oltean
  Cc: netdev@vger.kernel.org

Primary reason for this change is to remove the misuse of MDIO_NAME_SIZE
here, so that this constant can be removed in a follow-up patch.
Use case here is simply a chip name w/o any relationship to a MDIO
device. Also there's no need to reserve a longer char array, so make
the name a pointer.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/adi/adin1110.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 30f9d271e59..01b1bbcce48 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -123,7 +123,7 @@ enum adin1110_chips_id {
 
 struct adin1110_cfg {
 	enum adin1110_chips_id	id;
-	char			name[MDIO_NAME_SIZE];
+	const char		*name;
 	u32			phy_ids[PHY_MAX_ADDR];
 	u32			ports_nr;
 	u32			phy_id_val;
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias
  2026-01-31 17:36 [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching Heiner Kallweit
  2026-01-31 17:37 ` [PATCH net-next 1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer Heiner Kallweit
@ 2026-01-31 17:38 ` Heiner Kallweit
  2026-02-02 12:36   ` Vladimir Oltean
  2026-01-31 17:40 ` [PATCH net-next 3/3] net: phy: remove modalias-based mdio bus matching Heiner Kallweit
  2026-02-03 12:11 ` [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device " patchwork-bot+netdevbpf
  3 siblings, 1 reply; 6+ messages in thread
From: Heiner Kallweit @ 2026-01-31 17:38 UTC (permalink / raw)
  To: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, David Miller, Simon Horman,
	Michael Hennerich, Alexandru Tachici, Vladimir Oltean
  Cc: netdev@vger.kernel.org

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>
---
 drivers/net/dsa/dsa_loop.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 4a416f2717b..b41254b3ac4 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -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);
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 3/3] net: phy: remove modalias-based mdio bus matching
  2026-01-31 17:36 [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching Heiner Kallweit
  2026-01-31 17:37 ` [PATCH net-next 1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer Heiner Kallweit
  2026-01-31 17:38 ` [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias Heiner Kallweit
@ 2026-01-31 17:40 ` Heiner Kallweit
  2026-02-03 12:11 ` [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device " patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: Heiner Kallweit @ 2026-01-31 17:40 UTC (permalink / raw)
  To: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, David Miller, Simon Horman,
	Michael Hennerich, Alexandru Tachici, Vladimir Oltean
  Cc: netdev@vger.kernel.org

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 <hkallweit1@gmail.com>
---
 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 6e90ed42cd9..65636070a22 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 42d6d47e445..7ad7ce48f53 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 24eb5a88a5c..5b1725fe970 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.52.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias
  2026-01-31 17:38 ` [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias Heiner Kallweit
@ 2026-02-02 12:36   ` Vladimir Oltean
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2026-02-02 12:36 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Andrew Lunn, Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, David Miller, Simon Horman,
	Michael Hennerich, Alexandru Tachici, netdev@vger.kernel.org

On Sat, Jan 31, 2026 at 06:38:56PM +0100, Heiner Kallweit wrote:
> 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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching
  2026-01-31 17:36 [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching Heiner Kallweit
                   ` (2 preceding siblings ...)
  2026-01-31 17:40 ` [PATCH net-next 3/3] net: phy: remove modalias-based mdio bus matching Heiner Kallweit
@ 2026-02-03 12:11 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-03 12:11 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: andrew, andrew+netdev, linux, pabeni, edumazet, kuba, davem,
	horms, michael.hennerich, alexandru.tachici, olteanv, netdev

Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sat, 31 Jan 2026 18:36:07 +0100 you wrote:
> modalias-based MDIO device bus matching has only one user (dsa-loop),
> where we can replace modalias-based matching with a simple custom
> match function. This, and first patch of the series, lay the foundation
> for removing modalias-based matching.
> 
> Heiner Kallweit (3):
>   net: ethernet: adi: make name member of struct adin1110_cfg a pointer
>   net: dsa: loop: remove MDIO device modalias
>   net: phy: remove modalias-based mdio bus matching
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer
    https://git.kernel.org/netdev/net-next/c/f7aa2ef10c0e
  - [net-next,2/3] net: dsa: loop: remove MDIO device modalias
    https://git.kernel.org/netdev/net-next/c/5fddafbb92e0
  - [net-next,3/3] net: phy: remove modalias-based mdio bus matching
    https://git.kernel.org/netdev/net-next/c/3051419f3d1a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-03 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-31 17:36 [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device bus matching Heiner Kallweit
2026-01-31 17:37 ` [PATCH net-next 1/3] net: ethernet: adi: make name member of struct adin1110_cfg a pointer Heiner Kallweit
2026-01-31 17:38 ` [PATCH net-next 2/3] net: dsa: loop: remove MDIO device modalias Heiner Kallweit
2026-02-02 12:36   ` Vladimir Oltean
2026-01-31 17:40 ` [PATCH net-next 3/3] net: phy: remove modalias-based mdio bus matching Heiner Kallweit
2026-02-03 12:11 ` [PATCH net-next 0/3] net: phy: remove modalias-based MDIO device " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox