Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250919103944.854845-2-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Thorsten Blum and committed by
Jakub Kicinski
530ae8ec 312e6a58

+2 -3
+2 -3
drivers/net/phy/ax88796b.c
··· 112 112 .resume = genphy_resume, 113 113 .soft_reset = asix_soft_reset, 114 114 }, { 115 - .phy_id = PHY_ID_ASIX_AX88796B, 115 + PHY_ID_MATCH_MODEL(PHY_ID_ASIX_AX88796B), 116 116 .name = "Asix Electronics AX88796B", 117 - .phy_id_mask = 0xfffffff0, 118 117 /* PHY_BASIC_FEATURES */ 119 118 .soft_reset = asix_soft_reset, 120 119 } }; ··· 123 124 static const struct mdio_device_id __maybe_unused asix_tbl[] = { 124 125 { PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772A) }, 125 126 { PHY_ID_MATCH_EXACT(PHY_ID_ASIX_AX88772C) }, 126 - { PHY_ID_ASIX_AX88796B, 0xfffffff0 }, 127 + { PHY_ID_MATCH_MODEL(PHY_ID_ASIX_AX88796B) }, 127 128 { } 128 129 }; 129 130