[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <250cdfef.1bfc.192cd6a1f72.Coremail.andyshrk@163.com>
Date: Sun, 27 Oct 2024 17:58:57 +0800 (CST)
From: "Andy Yan" <andyshrk@....com>
To: "Johan Jonker" <jbx6244@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
david.wu@...k-chips.com, andy.yan@...k-chips.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rockchip@...ts.infradead.org
Subject: Re:[PATCH v1 2/2] net: arc: rockchip: fix emac mdio node support
Hello Johan,
Thanks for your patch. Maybe we need a Fixes tag here?
And for the patch itself:
Tested-by: Andy Yan <andyshrk@....com>
At 2024-10-27 17:42:45, "Johan Jonker" <jbx6244@...il.com> wrote:
>The binding emac_rockchip.txt is converted to YAML.
>Changed against the original binding is an added MDIO subnode.
>Fix emac_mdio.c so that it can handle both old and new
>device trees.
>
>Signed-off-by: Johan Jonker <jbx6244@...il.com>
>---
> drivers/net/ethernet/arc/emac_mdio.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ethernet/arc/emac_mdio.c b/drivers/net/ethernet/arc/emac_mdio.c
>index 87f40c2ba904..078b1a72c161 100644
>--- a/drivers/net/ethernet/arc/emac_mdio.c
>+++ b/drivers/net/ethernet/arc/emac_mdio.c
>@@ -133,6 +133,7 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
> struct arc_emac_mdio_bus_data *data = &priv->bus_data;
> struct device_node *np = priv->dev->of_node;
> const char *name = "Synopsys MII Bus";
>+ struct device_node *mdio_node;
> struct mii_bus *bus;
> int error;
>
>@@ -164,7 +165,13 @@ int arc_mdio_probe(struct arc_emac_priv *priv)
>
> snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);
>
>- error = of_mdiobus_register(bus, priv->dev->of_node);
>+ /* Backwards compatibility for EMAC nodes without MDIO subnode. */
>+ mdio_node = of_get_child_by_name(np, "mdio");
>+ if (!mdio_node)
>+ mdio_node = of_node_get(np);
>+
>+ error = of_mdiobus_register(bus, mdio_node);
>+ of_node_put(mdio_node);
> if (error) {
> mdiobus_free(bus);
> return dev_err_probe(priv->dev, error,
>--
>2.39.2
>
>
>_______________________________________________
>Linux-rockchip mailing list
>Linux-rockchip@...ts.infradead.org
>http://lists.infradead.org/mailman/listinfo/linux-rockchip
Powered by blists - more mailing lists