[PATCH 29/41] net: phy: vitesse: Convert to U_BOOT_PHY_DRIVER()
Ramon Fried
rfried.dev at gmail.com
Sat Apr 1 20:45:17 CEST 2023
On Sun, Mar 19, 2023 at 7:05 PM Marek Vasut
<marek.vasut+renesas at mailbox.org> wrote:
>
> 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 at mailbox.org>
> ---
> Cc: "Ariel D'Alessandro" <ariel.dalessandro at collabora.com>
> Cc: "Cédric Le Goater" <clg at kaod.org>
> Cc: "Marek Behún" <kabel at kernel.org>
> Cc: Alex Nemirovsky <alex.nemirovsky at cortina-access.com>
> Cc: Haolin Li <li.haolin at qq.com>
> Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Cc: Joel Stanley <joel at jms.id.au>
> Cc: Josua Mayer <josua at solid-run.com>
> Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
> Cc: Michael Trimarchi <michael at amarulasolutions.com>
> Cc: Michal Simek <michal.simek at amd.com>
> Cc: Nate Drude <nate.d at variscite.com>
> Cc: Neil Armstrong <neil.armstrong at linaro.org>
> Cc: Radu Pirea <radu-nicolae.pirea at oss.nxp.com>
> Cc: Ramon Fried <rfried.dev at gmail.com>
> Cc: Samuel Mendoza-Jonas <sam at mendozajonas.com>
> Cc: Stefan Roese <sr at denx.de>
> Cc: T Karthik Reddy <t.karthik.reddy at xilinx.com>
> Cc: Tim Harvey <tharvey at gateworks.com>
> Cc: Vladimir Oltean <vladimir.oltean at nxp.com>
> Cc: u-boot-amlogic at groups.io
> ---
> drivers/net/phy/phy.c | 3 ---
> drivers/net/phy/vitesse.c | 45 +++++++++++----------------------------
> include/phy.h | 1 -
> 3 files changed, 13 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 404d61c5ab3..fff1d669fcd 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -514,9 +514,6 @@ int phy_init(void)
> phy_drv_reloc(drv);
> #endif
>
> -#ifdef CONFIG_PHY_VITESSE
> - phy_vitesse_init();
> -#endif
> #ifdef CONFIG_PHY_XILINX
> phy_xilinx_init();
> #endif
> diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
> index eca26c98938..c5cf0d7dfbd 100644
> --- a/drivers/net/phy/vitesse.c
> +++ b/drivers/net/phy/vitesse.c
> @@ -293,7 +293,7 @@ static int vsc8664_config(struct phy_device *phydev)
> return 0;
> }
>
> -static struct phy_driver VSC8211_driver = {
> +U_BOOT_PHY_DRIVER(vsc8211) = {
> .name = "Vitesse VSC8211",
> .uid = 0xfc4b0,
> .mask = 0xffff0,
> @@ -303,7 +303,7 @@ static struct phy_driver VSC8211_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8221_driver = {
> +U_BOOT_PHY_DRIVER(vsc8221) = {
> .name = "Vitesse VSC8221",
> .uid = 0xfc550,
> .mask = 0xffff0,
> @@ -313,7 +313,7 @@ static struct phy_driver VSC8221_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8244_driver = {
> +U_BOOT_PHY_DRIVER(vsc8244) = {
> .name = "Vitesse VSC8244",
> .uid = 0xfc6c0,
> .mask = 0xffff0,
> @@ -323,7 +323,7 @@ static struct phy_driver VSC8244_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8234_driver = {
> +U_BOOT_PHY_DRIVER(vsc8234) = {
> .name = "Vitesse VSC8234",
> .uid = 0xfc620,
> .mask = 0xffff0,
> @@ -333,7 +333,7 @@ static struct phy_driver VSC8234_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8574_driver = {
> +U_BOOT_PHY_DRIVER(vsc8574) = {
> .name = "Vitesse VSC8574",
> .uid = 0x704a0,
> .mask = 0xffff0,
> @@ -343,7 +343,7 @@ static struct phy_driver VSC8574_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8514_driver = {
> +U_BOOT_PHY_DRIVER(vsc8514) = {
> .name = "Vitesse VSC8514",
> .uid = 0x70670,
> .mask = 0xffff0,
> @@ -353,7 +353,7 @@ static struct phy_driver VSC8514_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8584_driver = {
> +U_BOOT_PHY_DRIVER(vsc8584) = {
> .name = "Vitesse VSC8584",
> .uid = 0x707c0,
> .mask = 0xffff0,
> @@ -363,7 +363,7 @@ static struct phy_driver VSC8584_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8601_driver = {
> +U_BOOT_PHY_DRIVER(vsc8601) = {
> .name = "Vitesse VSC8601",
> .uid = 0x70420,
> .mask = 0xffff0,
> @@ -373,7 +373,7 @@ static struct phy_driver VSC8601_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8641_driver = {
> +U_BOOT_PHY_DRIVER(vsc8641) = {
> .name = "Vitesse VSC8641",
> .uid = 0x70430,
> .mask = 0xffff0,
> @@ -383,7 +383,7 @@ static struct phy_driver VSC8641_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8662_driver = {
> +U_BOOT_PHY_DRIVER(vsc8662) = {
> .name = "Vitesse VSC8662",
> .uid = 0x70660,
> .mask = 0xffff0,
> @@ -393,7 +393,7 @@ static struct phy_driver VSC8662_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver VSC8664_driver = {
> +U_BOOT_PHY_DRIVER(vsc8664) = {
> .name = "Vitesse VSC8664",
> .uid = 0x70660,
> .mask = 0xffff0,
> @@ -404,7 +404,7 @@ static struct phy_driver VSC8664_driver = {
> };
>
> /* Vitesse bought Cicada, so we'll put these here */
> -static struct phy_driver cis8201_driver = {
> +U_BOOT_PHY_DRIVER(cis8201) = {
> .name = "CIS8201",
> .uid = 0xfc410,
> .mask = 0xffff0,
> @@ -414,7 +414,7 @@ static struct phy_driver cis8201_driver = {
> .shutdown = &genphy_shutdown,
> };
>
> -static struct phy_driver cis8204_driver = {
> +U_BOOT_PHY_DRIVER(cis8204) = {
> .name = "Cicada Cis8204",
> .uid = 0xfc440,
> .mask = 0xffff0,
> @@ -423,22 +423,3 @@ static struct phy_driver cis8204_driver = {
> .startup = &vitesse_startup,
> .shutdown = &genphy_shutdown,
> };
> -
> -int phy_vitesse_init(void)
> -{
> - phy_register(&VSC8641_driver);
> - phy_register(&VSC8601_driver);
> - phy_register(&VSC8234_driver);
> - phy_register(&VSC8244_driver);
> - phy_register(&VSC8211_driver);
> - phy_register(&VSC8221_driver);
> - phy_register(&VSC8574_driver);
> - phy_register(&VSC8584_driver);
> - phy_register(&VSC8514_driver);
> - phy_register(&VSC8662_driver);
> - phy_register(&VSC8664_driver);
> - phy_register(&cis8201_driver);
> - phy_register(&cis8204_driver);
> -
> - return 0;
> -}
> diff --git a/include/phy.h b/include/phy.h
> index e6508a132d0..74f3ada2491 100644
> --- a/include/phy.h
> +++ b/include/phy.h
> @@ -315,7 +315,6 @@ int gen10g_startup(struct phy_device *phydev);
> int gen10g_shutdown(struct phy_device *phydev);
> int gen10g_discover_mmds(struct phy_device *phydev);
>
> -int phy_vitesse_init(void);
> int phy_xilinx_init(void);
> int phy_xway_init(void);
> int phy_mscc_init(void);
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
More information about the U-Boot
mailing list