summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2016-08-01 07:02:42 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-08-02 04:43:49 (GMT)
commit4613b279bee7954f1378c6339618641fdc4a675f (patch)
tree869893e846d9ab85e10d0b512381553eff475718 /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
parentf7113b3af1ab5218882a79ac1bbeeaad4f46fbc3 (diff)
downloadlinux-4613b279bee7954f1378c6339618641fdc4a675f.tar.xz
ethernet: stmicro: stmmac: add missing of_node_put after calling of_parse_phandle
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. This commit fixes both local (in stmmac_axi_setup) and global (plat->phy_node) device_node for this issue, and using the correct device node when tries to put node at stmmac_probe_config_dt for error path. Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c23ccab..4c8c60a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3397,6 +3397,7 @@ int stmmac_dvr_remove(struct device *dev)
stmmac_set_mac(priv->ioaddr, false);
netif_carrier_off(ndev);
unregister_netdev(ndev);
+ of_node_put(priv->plat->phy_node);
if (priv->stmmac_rst)
reset_control_assert(priv->stmmac_rst);
clk_disable_unprepare(priv->pclk);