diff options
author | Roosen Henri <Henri.Roosen@ginzinger.com> | 2016-01-07 03:31:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-08 21:48:34 -0500 |
commit | b4c19f71252e3b6b8c6478fd712c592f00b11438 (patch) | |
tree | f543d81ed61d6d7f988de7a475bf1c28c227029d | |
parent | b1c1f23ef0c64fb7e54c5b44015640e068643023 (diff) |
phy: micrel: Fix finding PHY properties in MAC node for KSZ9031.
Commit 651df2183543 ("phy: micrel: Fix finding PHY properties in MAC
node.") only fixes finding PHY properties in MAC node for KSZ9021. This
commit applies the same fix for KSZ9031.
Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.")
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Henri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/micrel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index e13ad6cdcc22..7a5679982c03 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -470,9 +470,17 @@ static int ksz9031_config_init(struct phy_device *phydev) | |||
470 | "txd2-skew-ps", "txd3-skew-ps" | 470 | "txd2-skew-ps", "txd3-skew-ps" |
471 | }; | 471 | }; |
472 | static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; | 472 | static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; |
473 | const struct device *dev_walker; | ||
473 | 474 | ||
474 | if (!of_node && dev->parent->of_node) | 475 | /* The Micrel driver has a deprecated option to place phy OF |
475 | of_node = dev->parent->of_node; | 476 | * properties in the MAC node. Walk up the tree of devices to |
477 | * find a device with an OF node. | ||
478 | */ | ||
479 | dev_walker = &phydev->dev; | ||
480 | do { | ||
481 | of_node = dev_walker->of_node; | ||
482 | dev_walker = dev_walker->parent; | ||
483 | } while (!of_node && dev_walker); | ||
476 | 484 | ||
477 | if (of_node) { | 485 | if (of_node) { |
478 | ksz9031_of_load_skew_values(phydev, of_node, | 486 | ksz9031_of_load_skew_values(phydev, of_node, |