phy: micrel: Fix finding PHY properties in MAC node.
authorAndrew Lunn <andrew@lunn.ch>
Wed, 9 Dec 2015 18:56:31 +0000 (19:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Dec 2015 01:31:15 +0000 (20:31 -0500)
commit651df2183543bc92f5dbcf99cd9e236ead0bc4c5
tree61737e65b1b4518913f7543a87d07bdec3d8afe8
parent9470e24f35ab81574da54e69df90c1eb4a96b43f
phy: micrel: Fix finding PHY properties in MAC node.

commit 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus,
not the bus' parent.")  changed the parenting of PHY devices, making
them a child of the MDIO bus, instead of the MAC device. This broken
the Micrel PHY driver which has a deprecated feature of allowing PHY
properties to be placed into the MAC node.

In order to find the MAC node, we need to walk up the tree of devices
until we find one with an OF node attached.

Reported-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Suggested-by: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c