Re: [PATCH 02/14] net: altera_tsa: Switch to new U-Boot PHY API

2023-06-10 Thread Ramon Fried
On Wed, May 31, 2023 at 1:51 AM Marek Vasut
 wrote:
>
> Use new U-Boot phy_connect() API which also supports fixed PHYs.
>
> Signed-off-by: Marek Vasut 
> ---
> Cc: Geert Uytterhoeven 
> Cc: Joe Hershberger 
> Cc: Michal Simek 
> Cc: Nishanth Menon 
> Cc: Ramon Fried 
> ---
>  drivers/net/altera_tse.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
> index 912d28fca2e..e2340936fa6 100644
> --- a/drivers/net/altera_tse.c
> +++ b/drivers/net/altera_tse.c
> @@ -430,17 +430,11 @@ static int tse_mdio_init(const char *name, struct 
> altera_tse_priv *priv)
>  static int tse_phy_init(struct altera_tse_priv *priv, void *dev)
>  {
> struct phy_device *phydev;
> -   unsigned int mask = 0x;
>
> -   if (priv->phyaddr)
> -   mask = 1 << priv->phyaddr;
> -
> -   phydev = phy_find_by_mask(priv->bus, mask);
> +   phydev = phy_connect(priv->bus, -1, dev, priv->interface);
> if (!phydev)
> return -ENODEV;
>
> -   phy_connect_dev(phydev, dev, priv->interface);
> -
> phydev->supported &= PHY_GBIT_FEATURES;
> phydev->advertising = phydev->supported;
>
> --
> 2.39.2
>
Reviewed-by: Ramon Fried 


[PATCH 02/14] net: altera_tsa: Switch to new U-Boot PHY API

2023-05-30 Thread Marek Vasut
Use new U-Boot phy_connect() API which also supports fixed PHYs.

Signed-off-by: Marek Vasut 
---
Cc: Geert Uytterhoeven 
Cc: Joe Hershberger 
Cc: Michal Simek 
Cc: Nishanth Menon 
Cc: Ramon Fried 
---
 drivers/net/altera_tse.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index 912d28fca2e..e2340936fa6 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -430,17 +430,11 @@ static int tse_mdio_init(const char *name, struct 
altera_tse_priv *priv)
 static int tse_phy_init(struct altera_tse_priv *priv, void *dev)
 {
struct phy_device *phydev;
-   unsigned int mask = 0x;
 
-   if (priv->phyaddr)
-   mask = 1 << priv->phyaddr;
-
-   phydev = phy_find_by_mask(priv->bus, mask);
+   phydev = phy_connect(priv->bus, -1, dev, priv->interface);
if (!phydev)
return -ENODEV;
 
-   phy_connect_dev(phydev, dev, priv->interface);
-
phydev->supported &= PHY_GBIT_FEATURES;
phydev->advertising = phydev->supported;
 
-- 
2.39.2