summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qualcomm/emac/emac-phy.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-06 09:39:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-06 09:39:13 +0100
commit17fa87fe5a5141d3c082c5c91e950aca9e0ec701 (patch)
tree5aea2ff6b9b16b49585684c5f2ce404fe444a9ba /drivers/net/ethernet/qualcomm/emac/emac-phy.c
parent3b28f4f2c2c7fcb6770cdfe5e8cd284ee1bc9783 (diff)
parentd5adbfcd5f7bcc6fa58a41c5c5ada0e5c826ce2c (diff)
downloadlinux-17fa87fe5a5141d3c082c5c91e950aca9e0ec701.tar.gz
linux-17fa87fe5a5141d3c082c5c91e950aca9e0ec701.tar.xz
Merge 4.10-rc7 into char-misc-next
We want the hv and other fixes in here as well to handle merge and testing issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac/emac-phy.c')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac-phy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-phy.c b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
index 99a14df28b96..2851b4c56570 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-phy.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
@@ -201,6 +201,13 @@ int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt)
else
adpt->phydev = mdiobus_get_phy(mii_bus, phy_addr);
+ /* of_phy_find_device() claims a reference to the phydev,
+ * so we do that here manually as well. When the driver
+ * later unloads, it can unilaterally drop the reference
+ * without worrying about ACPI vs DT.
+ */
+ if (adpt->phydev)
+ get_device(&adpt->phydev->mdio.dev);
} else {
struct device_node *phy_np;