summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-12-12 10:49:15 +0000
committerDavid S. Miller <davem@davemloft.net>2017-12-13 15:01:47 -0500
commit94a5ef1b77da4674a6bc1d3de3051b758859d106 (patch)
treefe56edf1fd11c69fd8459067f455cd898973f627 /drivers/of
parentf5e64032a799d4f54decc7eb6aafcdffb67f9ad9 (diff)
downloadlinux-stable-94a5ef1b77da4674a6bc1d3de3051b758859d106.tar.gz
linux-stable-94a5ef1b77da4674a6bc1d3de3051b758859d106.tar.bz2
linux-stable-94a5ef1b77da4674a6bc1d3de3051b758859d106.zip
of_mdio / mdiobus: ensure mdio devices have fwnode correctly populated
Ensure that all mdio devices populate the struct device fwnode pointer as well as the of_node pointer to allow drivers that wish to use fwnode APIs to work. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_mdio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index 98258583abb0..3481e69738b5 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -81,6 +81,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio,
* can be looked up later */
of_node_get(child);
phy->mdio.dev.of_node = child;
+ phy->mdio.dev.fwnode = of_fwnode_handle(child);
/* All data is now stored in the phy struct;
* register it */
@@ -111,6 +112,7 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
*/
of_node_get(child);
mdiodev->dev.of_node = child;
+ mdiodev->dev.fwnode = of_fwnode_handle(child);
/* All data is now stored in the mdiodev struct; register it. */
rc = mdio_device_register(mdiodev);
@@ -206,6 +208,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
mdio->phy_mask = ~0;
mdio->dev.of_node = np;
+ mdio->dev.fwnode = of_fwnode_handle(np);
/* Get bus level PHY reset GPIO details */
mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY;