]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: phy: ax88796b: Replace hard-coded values with PHY_ID_MATCH_MODEL()
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 19 Sep 2025 10:39:45 +0000 (12:39 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 22 Sep 2025 23:38:59 +0000 (16:38 -0700)
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>
drivers/net/phy/ax88796b.c

index 694df1401aa2aaf96fcffc1ce529a7ef505933f4..f20ddf64914993f7097070d1f56c1103ec1e40e8 100644 (file)
@@ -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) },
        { }
 };