From: Johan Jonker <jbx6244@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: david.wu@rock-chips.com, andy.yan@rock-chips.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rockchip@lists.infradead.org
Subject: [PATCH v1 2/2] net: arc: rockchip: fix emac mdio node support
Date: Sun, 27 Oct 2024 10:42:45 +0100 [thread overview]
Message-ID: <f04c2cfd-d2d6-4dc6-91a5-0ed1d1155171@gmail.com> (raw)
In-Reply-To: <dcb70a05-2607-47dd-8abd-f6cf1b012c51@gmail.com>
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@gmail.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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2024-10-27 9:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-27 9:41 [PATCH v1 1/2] ethernet: arc: fix the device for dma_map_single/dma_unmap_single Johan Jonker
2024-10-27 9:42 ` Johan Jonker [this message]
2024-10-27 9:58 ` Re:[PATCH v1 2/2] net: arc: rockchip: fix emac mdio node support Andy Yan
2024-10-28 12:59 ` [PATCH " Andrew Lunn
2024-10-29 8:22 ` Andy Yan
2024-10-29 12:46 ` Andrew Lunn
2024-10-28 13:03 ` [PATCH v1 1/2] ethernet: arc: fix the device for dma_map_single/dma_unmap_single Andrew Lunn
2024-10-29 14:53 ` Johan Jonker
2024-10-30 0:19 ` Andy Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f04c2cfd-d2d6-4dc6-91a5-0ed1d1155171@gmail.com \
--to=jbx6244@gmail.com \
--cc=andy.yan@rock-chips.com \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox