diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2014-08-07 17:06:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-07 19:02:59 -0400 |
commit | 129cc83a0b7ed9429d896e4f215d1f6a8c58ba40 (patch) | |
tree | 6ab2652fb4375470a20f2c4fff8691b0fdd7ccf8 /drivers/net/ethernet | |
parent | 9518259ffc87328676bf2c2041348c5181856f96 (diff) |
net: fs_enet: fix reference counting for phy_node
Make sure that fs_enet_probe is left with a reference to the phy node.
In the presence of a phy handle this is already the case as
of_parse_phandle returns a reference. In the fixed phy case a call to
of_node_get is necessary. Otherwise the error path and remove function
drop a reference the driver isn't holding.
Fixes: bb74d9a4a87b ("fs_enet: use the new fixed PHY helpers")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index cfaf17b70f3f..748fd24d3d9e 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | |||
@@ -1033,7 +1033,7 @@ static int fs_enet_probe(struct platform_device *ofdev) | |||
1033 | /* In the case of a fixed PHY, the DT node associated | 1033 | /* In the case of a fixed PHY, the DT node associated |
1034 | * to the PHY is the Ethernet MAC DT node. | 1034 | * to the PHY is the Ethernet MAC DT node. |
1035 | */ | 1035 | */ |
1036 | fpi->phy_node = ofdev->dev.of_node; | 1036 | fpi->phy_node = of_node_get(ofdev->dev.of_node); |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) { | 1039 | if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) { |