[PATCH 08/41] net: phy: aquantia: Convert to U_BOOT_PHY_DRIVER()

Marek Vasut marek.vasut+renesas at mailbox.org
Sun Mar 19 18:02:44 CET 2023


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/aquantia.c | 33 +++++++++------------------------
 drivers/net/phy/phy.c      |  3 ---
 include/phy.h              |  1 -
 3 files changed, 9 insertions(+), 28 deletions(-)

diff --git a/drivers/net/phy/aquantia.c b/drivers/net/phy/aquantia.c
index fa887ade0c2..a958e88d44f 100644
--- a/drivers/net/phy/aquantia.c
+++ b/drivers/net/phy/aquantia.c
@@ -598,7 +598,7 @@ int aquantia_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver aq1202_driver = {
+U_BOOT_PHY_DRIVER(aq1202) = {
 	.name = "Aquantia AQ1202",
 	.uid = 0x3a1b445,
 	.mask = 0xfffffff0,
@@ -611,7 +611,7 @@ static struct phy_driver aq1202_driver = {
 	.shutdown = &gen10g_shutdown,
 };
 
-static struct phy_driver aq2104_driver = {
+U_BOOT_PHY_DRIVER(aq2104) = {
 	.name = "Aquantia AQ2104",
 	.uid = 0x3a1b460,
 	.mask = 0xfffffff0,
@@ -624,7 +624,7 @@ static struct phy_driver aq2104_driver = {
 	.shutdown = &gen10g_shutdown,
 };
 
-static struct phy_driver aqr105_driver = {
+U_BOOT_PHY_DRIVER(aqr105) = {
 	.name = "Aquantia AQR105",
 	.uid = 0x3a1b4a2,
 	.mask = 0xfffffff0,
@@ -638,7 +638,7 @@ static struct phy_driver aqr105_driver = {
 	.data = AQUANTIA_GEN1,
 };
 
-static struct phy_driver aqr106_driver = {
+U_BOOT_PHY_DRIVER(aqr106) = {
 	.name = "Aquantia AQR106",
 	.uid = 0x3a1b4d0,
 	.mask = 0xfffffff0,
@@ -651,7 +651,7 @@ static struct phy_driver aqr106_driver = {
 	.shutdown = &gen10g_shutdown,
 };
 
-static struct phy_driver aqr107_driver = {
+U_BOOT_PHY_DRIVER(aqr107) = {
 	.name = "Aquantia AQR107",
 	.uid = 0x3a1b4e0,
 	.mask = 0xfffffff0,
@@ -665,7 +665,7 @@ static struct phy_driver aqr107_driver = {
 	.data = AQUANTIA_GEN2,
 };
 
-static struct phy_driver aqr112_driver = {
+U_BOOT_PHY_DRIVER(aqr112) = {
 	.name = "Aquantia AQR112",
 	.uid = 0x3a1b660,
 	.mask = 0xfffffff0,
@@ -679,7 +679,7 @@ static struct phy_driver aqr112_driver = {
 	.data = AQUANTIA_GEN3,
 };
 
-static struct phy_driver aqr113c_driver = {
+U_BOOT_PHY_DRIVER(aqr113c) = {
 	.name = "Aquantia AQR113C",
 	.uid = 0x31c31c12,
 	.mask = 0xfffffff0,
@@ -693,7 +693,7 @@ static struct phy_driver aqr113c_driver = {
 	.data = AQUANTIA_GEN3,
 };
 
-static struct phy_driver aqr405_driver = {
+U_BOOT_PHY_DRIVER(aqr405) = {
 	.name = "Aquantia AQR405",
 	.uid = 0x3a1b4b2,
 	.mask = 0xfffffff0,
@@ -707,7 +707,7 @@ static struct phy_driver aqr405_driver = {
 	.data = AQUANTIA_GEN1,
 };
 
-static struct phy_driver aqr412_driver = {
+U_BOOT_PHY_DRIVER(aqr412) = {
 	.name = "Aquantia AQR412",
 	.uid = 0x3a1b710,
 	.mask = 0xfffffff0,
@@ -720,18 +720,3 @@ static struct phy_driver aqr412_driver = {
 	.shutdown = &gen10g_shutdown,
 	.data = AQUANTIA_GEN3,
 };
-
-int phy_aquantia_init(void)
-{
-	phy_register(&aq1202_driver);
-	phy_register(&aq2104_driver);
-	phy_register(&aqr105_driver);
-	phy_register(&aqr106_driver);
-	phy_register(&aqr107_driver);
-	phy_register(&aqr112_driver);
-	phy_register(&aqr113c_driver);
-	phy_register(&aqr405_driver);
-	phy_register(&aqr412_driver);
-
-	return 0;
-}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ecb4b72ed10..4f17f98876e 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -520,9 +520,6 @@ int phy_init(void)
 #ifdef CONFIG_MV88E61XX_SWITCH
 	phy_mv88e61xx_init();
 #endif
-#ifdef CONFIG_PHY_AQUANTIA
-	phy_aquantia_init();
-#endif
 #ifdef CONFIG_PHY_ATHEROS
 	phy_atheros_init();
 #endif
diff --git a/include/phy.h b/include/phy.h
index dbc0da7e084..a0060cd19ea 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -317,7 +317,6 @@ int gen10g_discover_mmds(struct phy_device *phydev);
 
 int phy_b53_init(void);
 int phy_mv88e61xx_init(void);
-int phy_aquantia_init(void);
 int phy_atheros_init(void);
 int phy_broadcom_init(void);
 int phy_cortina_init(void);
-- 
2.39.2



More information about the U-Boot mailing list