From: Timur Tabi <timur@freescale.com>
To: <david.daney@cavium.com>, David Miller <davem@davemloft.net>,
<netdev@vger.kernel.org>
Subject: [PATCH] netdev/phy: skip disabled mdio-mux nodes
Date: Tue, 7 Aug 2012 11:51:06 -0500 [thread overview]
Message-ID: <1344358266-5450-1-git-send-email-timur@freescale.com> (raw)
The mdio-mux driver scans all child mdio nodes, without regard to whether
the node is actually used. Some device trees include all possible
mdio-mux nodes and rely on the boot loader to disable those that are not
present, based on some run-time configuration. Those nodes need to be
skipped.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
drivers/net/phy/mdio-mux.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
index 5c12018..d0c231e 100644
--- a/drivers/net/phy/mdio-mux.c
+++ b/drivers/net/phy/mdio-mux.c
@@ -135,6 +135,15 @@ int mdio_mux_init(struct device *dev,
for_each_child_of_node(dev->of_node, child_bus_node) {
u32 v;
+ /*
+ * Some device trees include all possible mdio-mux nodes and
+ * rely on the boot loader to disable those that are not
+ * present, based on some run-time configuration. Those nodes
+ * need to be skipped.
+ */
+ if (!of_device_is_available(child_bus_node))
+ continue;
+
r = of_property_read_u32(child_bus_node, "reg", &v);
if (r)
continue;
--
1.7.3.4
next reply other threads:[~2012-08-07 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 16:51 Timur Tabi [this message]
2012-08-07 16:59 ` [PATCH] netdev/phy: skip disabled mdio-mux nodes David Daney
[not found] ` <5021496D.8070200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-07 17:04 ` Timur Tabi
2012-08-14 19:19 ` Tabi Timur-B04825
2012-08-14 21:07 ` David Miller
2012-08-14 21:12 ` Timur Tabi
2012-08-14 21:16 ` David Miller
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=1344358266-5450-1-git-send-email-timur@freescale.com \
--to=timur@freescale.com \
--cc=davem@davemloft.net \
--cc=david.daney@cavium.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).