]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER()
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 19 Mar 2023 17:03:13 +0000 (18:03 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Fri, 7 Apr 2023 12:18:51 +0000 (14:18 +0200)
Convert PHY driver to U_BOOT_PHY_DRIVER() macro and drop phy_register() init call.

Converted using sed
"s@^static struct phy_driver \(.*\)_driver = \+{@U_BOOT_PHY_DRIVER(\L\1) = {"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Tested-by: Michal Simek <michal.simek@amd.com> #microblaze (MANUAL_RELOC)
drivers/net/phy/generic_10g.c
drivers/net/phy/phy.c
include/phy.h

index b4384e1f7818dcb2c9434a0475e2ccf2fd944673..34ac51ea070c8d3308e58782261c6905731336fd 100644 (file)
@@ -80,7 +80,7 @@ int gen10g_config(struct phy_device *phydev)
        return gen10g_discover_mmds(phydev);
 }
 
-struct phy_driver gen10g_driver = {
+U_BOOT_PHY_DRIVER(gen10g) = {
        .uid            = 0xffffffff,
        .mask           = 0xffffffff,
        .name           = "Generic 10G PHY",
index b1e9861c6f3dbfa5fa16030b3c492cc135bb28fd..bd9c576f4590a5efe592d8ee44a76d4242b5e3f5 100644 (file)
@@ -566,7 +566,7 @@ static struct phy_driver *generic_for_phy(struct phy_device *phydev)
 {
 #ifdef CONFIG_PHYLIB_10G
        if (phydev->is_c45)
-               return &gen10g_driver;
+               return ll_entry_get(struct phy_driver, gen10g, phy_driver);
 #endif
 
        return ll_entry_get(struct phy_driver, genphy, phy_driver);
index df2586f89ea263fe4274894d8b0bf12601e02c0e..5f4967cb1500d8a106aae17d18fd38796a0a88ca 100644 (file)
@@ -173,10 +173,6 @@ struct fixed_link {
        int asym_pause;
 };
 
-#ifdef CONFIG_PHYLIB_10G
-extern struct phy_driver gen10g_driver;
-#endif
-
 /**
  * phy_init() - Initializes the PHY drivers
  * This function registers all available PHY drivers