linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 4/7] net: ethernet: mtk-star-emac: Use of_get_available_child_by_name()
       [not found] <20250205124235.53285-1-biju.das.jz@bp.renesas.com>
@ 2025-02-05 12:42 ` Biju Das
  2025-02-07  9:51   ` Simon Horman
  2025-02-05 12:42 ` [PATCH net-next v2 5/7] net: ethernet: mtk_eth_soc: " Biju Das
  1 sibling, 1 reply; 4+ messages in thread
From: Biju Das @ 2025-02-05 12:42 UTC (permalink / raw)
  To: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Biju Das, netdev, linux-arm-kernel, linux-mediatek,
	Geert Uytterhoeven, Biju Das

Use the helper of_get_available_child_by_name() to simplify
mtk_star_mdio_init().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 *  Dropped using _free()
---
 drivers/net/ethernet/mediatek/mtk_star_emac.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c b/drivers/net/ethernet/mediatek/mtk_star_emac.c
index 25989c79c92e..76f202d7f055 100644
--- a/drivers/net/ethernet/mediatek/mtk_star_emac.c
+++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c
@@ -1427,15 +1427,10 @@ static int mtk_star_mdio_init(struct net_device *ndev)
 
 	of_node = dev->of_node;
 
-	mdio_node = of_get_child_by_name(of_node, "mdio");
+	mdio_node = of_get_available_child_by_name(of_node, "mdio");
 	if (!mdio_node)
 		return -ENODEV;
 
-	if (!of_device_is_available(mdio_node)) {
-		ret = -ENODEV;
-		goto out_put_node;
-	}
-
 	priv->mii = devm_mdiobus_alloc(dev);
 	if (!priv->mii) {
 		ret = -ENOMEM;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next v2 5/7] net: ethernet: mtk_eth_soc: Use of_get_available_child_by_name()
       [not found] <20250205124235.53285-1-biju.das.jz@bp.renesas.com>
  2025-02-05 12:42 ` [PATCH net-next v2 4/7] net: ethernet: mtk-star-emac: Use of_get_available_child_by_name() Biju Das
@ 2025-02-05 12:42 ` Biju Das
  2025-02-07  9:52   ` Simon Horman
  1 sibling, 1 reply; 4+ messages in thread
From: Biju Das @ 2025-02-05 12:42 UTC (permalink / raw)
  To: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Biju Das, netdev, linux-arm-kernel, linux-mediatek,
	Geert Uytterhoeven, Biju Das

Use the helper of_get_available_child_by_name() to simplify
mtk_mdio_init().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Dropped using _free().
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 53485142938c..0ad965ced5ef 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -830,17 +830,12 @@ static int mtk_mdio_init(struct mtk_eth *eth)
 	int ret;
 	u32 val;
 
-	mii_np = of_get_child_by_name(eth->dev->of_node, "mdio-bus");
+	mii_np = of_get_available_child_by_name(eth->dev->of_node, "mdio-bus");
 	if (!mii_np) {
 		dev_err(eth->dev, "no %s child node found", "mdio-bus");
 		return -ENODEV;
 	}
 
-	if (!of_device_is_available(mii_np)) {
-		ret = -ENODEV;
-		goto err_put_node;
-	}
-
 	eth->mii_bus = devm_mdiobus_alloc(eth->dev);
 	if (!eth->mii_bus) {
 		ret = -ENOMEM;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2 4/7] net: ethernet: mtk-star-emac: Use of_get_available_child_by_name()
  2025-02-05 12:42 ` [PATCH net-next v2 4/7] net: ethernet: mtk-star-emac: Use of_get_available_child_by_name() Biju Das
@ 2025-02-07  9:51   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-02-07  9:51 UTC (permalink / raw)
  To: Biju Das
  Cc: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno, netdev,
	linux-arm-kernel, linux-mediatek, Geert Uytterhoeven, Biju Das

On Wed, Feb 05, 2025 at 12:42:24PM +0000, Biju Das wrote:
> Use the helper of_get_available_child_by_name() to simplify
> mtk_star_mdio_init().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  *  Dropped using _free()

Reviewed-by: Simon Horman <horms@kernel.org>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2 5/7] net: ethernet: mtk_eth_soc: Use of_get_available_child_by_name()
  2025-02-05 12:42 ` [PATCH net-next v2 5/7] net: ethernet: mtk_eth_soc: " Biju Das
@ 2025-02-07  9:52   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-02-07  9:52 UTC (permalink / raw)
  To: Biju Das
  Cc: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Matthias Brugger, AngeloGioacchino Del Regno, netdev,
	linux-arm-kernel, linux-mediatek, Geert Uytterhoeven, Biju Das

On Wed, Feb 05, 2025 at 12:42:25PM +0000, Biju Das wrote:
> Use the helper of_get_available_child_by_name() to simplify
> mtk_mdio_init().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
>  * Dropped using _free().

Reviewed-by: Simon Horman <horms@kernel.org>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-07  9:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250205124235.53285-1-biju.das.jz@bp.renesas.com>
2025-02-05 12:42 ` [PATCH net-next v2 4/7] net: ethernet: mtk-star-emac: Use of_get_available_child_by_name() Biju Das
2025-02-07  9:51   ` Simon Horman
2025-02-05 12:42 ` [PATCH net-next v2 5/7] net: ethernet: mtk_eth_soc: " Biju Das
2025-02-07  9:52   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).