mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
phy: core: Add *release* phy_ops invoked when the consumer relinquishes PHY
Add a new phy_ops *release* invoked when the consumer relinquishes the PHY using phy_put/devm_phy_put. The initializations done by the PHY driver in of_xlate call back can be can be cleaned up here. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
parent
42c7cb71b5
commit
fec06b2bc4
2 changed files with 7 additions and 0 deletions
|
|
@ -564,6 +564,11 @@ void phy_put(struct phy *phy)
|
|||
if (!phy || IS_ERR(phy))
|
||||
return;
|
||||
|
||||
mutex_lock(&phy->mutex);
|
||||
if (phy->ops->release)
|
||||
phy->ops->release(phy);
|
||||
mutex_unlock(&phy->mutex);
|
||||
|
||||
module_put(phy->ops->owner);
|
||||
put_device(&phy->dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue