summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mvneta.c
diff options
context:
space:
mode:
authorRussell King2015-09-24 21:36:18 +0200
committerDavid S. Miller2015-09-25 08:04:53 +0200
commit04d53b20fe44afe635b3d4438b437f7a12927e9a (patch)
tree9edf8840e71724ca7e5a9c83208b2c4e1844a99d /drivers/net/ethernet/marvell/mvneta.c
parentof_mdio: fix MDIO phy device refcounting (diff)
downloadkernel-qcow2-linux-04d53b20fe44afe635b3d4438b437f7a12927e9a.tar.gz
kernel-qcow2-linux-04d53b20fe44afe635b3d4438b437f7a12927e9a.tar.xz
kernel-qcow2-linux-04d53b20fe44afe635b3d4438b437f7a12927e9a.zip
net: fix phy refcounting in a bunch of drivers
of_phy_find_device() increments the phy struct device refcount, which we need to properly balance. Add code to network drivers using this function to ensure that the struct device refcount is correctly balanced. For xgene, looking back in the history, we should be able to use of_phy_connect() with a zero flags argument for the DT case as this is how the driver used to operate prior to de7b5b3d790a ("net: eth: xgene: change APM X-Gene SoC platform ethernet to support ACPI"). This leaves the Cavium Thunder BGX unfixed; fixing this driver is a complicated task, one which the maintainers need to be involved with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvneta.c')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 09ec32e33076..514df76fc70f 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3175,6 +3175,8 @@ static int mvneta_probe(struct platform_device *pdev)
struct phy_device *phy = of_phy_find_device(dn);
mvneta_fixed_link_update(pp, phy);
+
+ put_device(&phy->dev);
}
return 0;