From: Marek Vasut Date: Sun, 19 Mar 2023 17:03:13 +0000 (+0100) Subject: net: phy: gen10g: Convert to U_BOOT_PHY_DRIVER() X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=20bd8e4fcbb537be0f564bbc90e3a571aeeabf8d;p=u-boot.git 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) --- 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