netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/phy: micrel: Follow attached_dev to get to the MAC device
@ 2015-10-16 20:49 Andrew Lunn
  2015-10-16 22:58 ` Dinh Nguyen
  2015-10-16 23:32 ` Sergei Shtylyov
  0 siblings, 2 replies; 14+ messages in thread
From: Andrew Lunn @ 2015-10-16 20:49 UTC (permalink / raw)
  To: Dinh Nguyen; +Cc: Florian Fainelli, netdev, Andrew Lunn

Commit "8b63ec1837fa phylib: Make PHYs children of their MDIO bus, not
the bus' parent." broke finding PHY properties in the MAC device tree
node. The parent device is now the MDIO bus, not the MAC. Use
attached_dev towards the MAC device tree node.

Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---

Compile tested only.

Dinh, please could you test it and report back if it works or not.

 drivers/net/phy/micrel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 499185eaf413..9e2083a1a5a9 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/phy.h>
+#include <linux/netdevice.h>
 #include <linux/micrel_phy.h>
 #include <linux/of.h>
 #include <linux/clk.h>
@@ -340,8 +341,9 @@ static int ksz9021_config_init(struct phy_device *phydev)
 	const struct device *dev = &phydev->dev;
 	const struct device_node *of_node = dev->of_node;
 
-	if (!of_node && dev->parent->of_node)
-		of_node = dev->parent->of_node;
+	if (!of_node && phydev->attached_dev &&
+	    phydev->attached_dev->dev.of_node)
+		of_node = phydev->attached_dev->dev.of_node;
 
 	if (of_node) {
 		ksz9021_load_values_from_of(phydev, of_node,
-- 
2.5.1

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

end of thread, other threads:[~2015-10-18  6:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 20:49 [PATCH] net/phy: micrel: Follow attached_dev to get to the MAC device Andrew Lunn
2015-10-16 22:58 ` Dinh Nguyen
2015-10-16 23:50   ` Andrew Lunn
2015-10-17 14:21     ` Dinh Nguyen
2015-10-17 15:06       ` Dinh Nguyen
2015-10-17 15:38         ` Andrew Lunn
2015-10-17 17:38         ` Florian Fainelli
2015-10-17 20:45       ` Andrew Lunn
2015-10-18  4:15         ` Dinh Nguyen
2015-10-18  5:54           ` Dinh Nguyen
2015-10-16 23:32 ` Sergei Shtylyov
2015-10-16 23:54   ` Andrew Lunn
2015-10-17 18:46     ` Sergei Shtylyov
2015-10-17 19:23     ` Sergei Shtylyov

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