diff mbox series

[09/20] net: tsec: Use ofnode_phy_is_fixed_link() API

Message ID 20210302153451.19440-10-bmeng.cn@gmail.com
State Superseded
Delegated to: Priyanka Jain
Headers show
Series ppc: qemu: Add eTSEC support | expand

Commit Message

Bin Meng March 2, 2021, 3:34 p.m. UTC
Switch to use the ofnode_phy_is_fixed_link() API which can support
both the new and old DT bindings.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/net/tsec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ramon Fried March 2, 2021, 5:42 p.m. UTC | #1
On Tue, Mar 2, 2021 at 5:35 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Switch to use the ofnode_phy_is_fixed_link() API which can support
> both the new and old DT bindings.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  drivers/net/tsec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index ec48689372..24f9962b82 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -15,6 +15,7 @@
>  #include <command.h>
>  #include <tsec.h>
>  #include <fsl_mdio.h>
> +#include <dm/of_extra.h>
>  #include <linux/bitops.h>
>  #include <linux/delay.h>
>  #include <linux/errno.h>
> @@ -707,8 +708,7 @@ static int init_phy(struct tsec_private *priv)
>                 tsec_configure_serdes(priv);
>
>  #if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_MDIO)
> -       if (ofnode_valid(ofnode_find_subnode(dev_ofnode(priv->dev),
> -                                            "fixed-link")))
> +       if (ofnode_phy_is_fixed_link(dev_ofnode(priv->dev), NULL))
>                 phydev = phy_connect(NULL, 0, priv->dev, priv->interface);
>         else
>                 phydev = dm_eth_phy_connect(priv->dev);
> --
> 2.25.1
>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index ec48689372..24f9962b82 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -15,6 +15,7 @@ 
 #include <command.h>
 #include <tsec.h>
 #include <fsl_mdio.h>
+#include <dm/of_extra.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -707,8 +708,7 @@  static int init_phy(struct tsec_private *priv)
 		tsec_configure_serdes(priv);
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_DM_MDIO)
-	if (ofnode_valid(ofnode_find_subnode(dev_ofnode(priv->dev),
-					     "fixed-link")))
+	if (ofnode_phy_is_fixed_link(dev_ofnode(priv->dev), NULL))
 		phydev = phy_connect(NULL, 0, priv->dev, priv->interface);
 	else
 		phydev = dm_eth_phy_connect(priv->dev);