phy: add proper phy struct device refcounting
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 24 Sep 2015 19:36:08 +0000 (20:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Sep 2015 06:04:52 +0000 (23:04 -0700)
commit7322967bc1bd97ac9c49ecea19e5a1f681ca27ee
tree8dbce2e4e1eb98757ef30b537977d447999b1582
parent3e3aaf649416988ca8be4ad2c52dc24d8be7b46e
phy: add proper phy struct device refcounting

Take a refcount on the phy struct device when the phy device is attached
to a network device, and drop it after it's detached.  This ensures that
a refcount is held on the phy device while the device is being used by
a network device, thereby preventing the phy_device from being
unexpectedly kfree()'d by phy_device_release().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c