From 20bd8e4fcbb537be0f564bbc90e3a571aeeabf8d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 19 Mar 2023 18:03:13 +0100 Subject: [PATCH] net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER() 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 Reviewed-by: Ramon Fried Acked-by: Michal Simek Tested-by: Michal Simek #microblaze (MANUAL_RELOC) --- drivers/net/phy/generic_10g.c | 2 +- drivers/net/phy/phy.c | 2 +- include/phy.h | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/generic_10g.c b/drivers/net/phy/generic_10g.c index b4384e1f78..34ac51ea07 100644 --- a/drivers/net/phy/generic_10g.c +++ b/drivers/net/phy/generic_10g.c @@ -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", diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index b1e9861c6f..bd9c576f45 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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); diff --git a/include/phy.h b/include/phy.h index df2586f89e..5f4967cb15 100644 --- a/include/phy.h +++ b/include/phy.h @@ -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 -- 2.39.5