diff mbox series

[05/14] net: pch_gbe: Switch to new U-Boot PHY API

Message ID 20230530225131.949721-5-marek.vasut+renesas@mailbox.org
State Accepted
Commit 8f5abff5221f42fe1478964f2fd4a19580c76f70
Delegated to: Ramon Fried
Headers show
Series [01/14] net: eth-phy: staticize eth_phy_reset() | expand

Commit Message

Marek Vasut May 30, 2023, 10:51 p.m. UTC
Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
---
 drivers/net/pch_gbe.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Ramon Fried June 10, 2023, 11 a.m. UTC | #1
On Wed, May 31, 2023 at 1:51 AM Marek Vasut
<marek.vasut+renesas@mailbox.org> wrote:
>
> Use new U-Boot phy_connect() API which also supports fixed PHYs.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Joe Hershberger <joe.hershberger@ni.com>
> Cc: Michal Simek <michal.simek@amd.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Ramon Fried <rfried.dev@gmail.com>
> ---
>  drivers/net/pch_gbe.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
> index ad7b5b8e99b..ecf8c28fe41 100644
> --- a/drivers/net/pch_gbe.c
> +++ b/drivers/net/pch_gbe.c
> @@ -414,16 +414,13 @@ static int pch_gbe_phy_init(struct udevice *dev)
>         struct pch_gbe_priv *priv = dev_get_priv(dev);
>         struct eth_pdata *plat = dev_get_plat(dev);
>         struct phy_device *phydev;
> -       int mask = 0xffffffff;
>
> -       phydev = phy_find_by_mask(priv->bus, mask);
> +       phydev = phy_connect(priv->bus, -1, dev, plat->phy_interface);
>         if (!phydev) {
>                 printf("pch_gbe: cannot find the phy\n");
>                 return -1;
>         }
>
> -       phy_connect_dev(phydev, dev, plat->phy_interface);
> -
>         phydev->supported &= PHY_GBIT_FEATURES;
>         phydev->advertising = phydev->supported;
>
> --
> 2.39.2
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c
index ad7b5b8e99b..ecf8c28fe41 100644
--- a/drivers/net/pch_gbe.c
+++ b/drivers/net/pch_gbe.c
@@ -414,16 +414,13 @@  static int pch_gbe_phy_init(struct udevice *dev)
 	struct pch_gbe_priv *priv = dev_get_priv(dev);
 	struct eth_pdata *plat = dev_get_plat(dev);
 	struct phy_device *phydev;
-	int mask = 0xffffffff;
 
-	phydev = phy_find_by_mask(priv->bus, mask);
+	phydev = phy_connect(priv->bus, -1, dev, plat->phy_interface);
 	if (!phydev) {
 		printf("pch_gbe: cannot find the phy\n");
 		return -1;
 	}
 
-	phy_connect_dev(phydev, dev, plat->phy_interface);
-
 	phydev->supported &= PHY_GBIT_FEATURES;
 	phydev->advertising = phydev->supported;