Skip to contentSkip to conversation

net: phy: ax88796b: Replace hard-coded values with PHY_ID_MATCH_MODEL()

PATCH Applied Thorsten Blum 2 participants 2 messages Sep 19, 2025 – Sep 22, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: ax88796b: Replace hard-coded values with PHY_ID_MATCH_MODEL()

Use the PHY_ID_MATCH_MODEL() macro instead of hardcoding the values in asix_driver[] and asix_tbl[].

In asix_tbl[], the macro also uses designated initializers instead of positional initializers, which allows the struct fields to be reordered.

---
 drivers/net/phy/ax88796b.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/phy/ax88796b.c +2 -3
index 694df1401aa2..f20ddf649149 100644
@@ -112,9 +112,8 @@ static struct phy_driver asix_driver[] = {
 	.resume		= genphy_resume,
 	.soft_reset	= asix_soft_reset,
 }, {
-	.phy_id		= PHY_ID_ASIX_AX88796B,
+	PHY_ID_MATCH_MODEL(PHY_ID_ASIX_AX88796B),
 	.name		= "Asix Electronics AX88796B",
-	.phy_id_mask	= 0xfffffff0,
 	/* PHY_BASIC_FEATURES */
 	.soft_reset	= asix_soft_reset,
 } };
@@ -124,7 +123,7 @@ module_phy_driver(asix_driver);
 static const struct mdio_device_id __maybe_unused asix_tbl[] = {
 	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772A) },
 	{ PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772C) },
-	{ PHY_ID_ASIX_AX88796B, 0xfffffff0 },
+	{ PHY_ID_MATCH_MODEL(PHY_ID_ASIX_AX88796B) },
 	{ }
 };
 
Signature · 1 line
2.51.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 19 Sep 2025 12:39:45 +0200 you wrote:

Use the PHY_ID_MATCH_MODEL() macro instead of hardcoding the values in asix_driver[] and asix_tbl[].

In asix_tbl[], the macro also uses designated initializers instead of positional initializers, which allows the struct fields to be reordered.

[...]

Here is the summary with links:
- [net-next] net: phy: ax88796b: Replace hard-coded values with PHY_ID_MATCH_MODEL()

    https://git.kernel.org/netdev/net-next/c/530ae8ec0e5e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html