netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netdev/phy: skip disabled mdio-mux nodes
@ 2012-08-07 16:51 Timur Tabi
  2012-08-07 16:59 ` David Daney
  2012-08-14 19:19 ` Tabi Timur-B04825
  0 siblings, 2 replies; 7+ messages in thread
From: Timur Tabi @ 2012-08-07 16:51 UTC (permalink / raw)
  To: david.daney, David Miller, netdev

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

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

end of thread, other threads:[~2012-08-14 21:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 16:51 [PATCH] netdev/phy: skip disabled mdio-mux nodes Timur Tabi
2012-08-07 16:59 ` 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

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).