Skip to content

Commit 4dc48c8

Browse files
Zijun Huvinodkoul
authored andcommitted
phy: core: Fix that API devm_phy_destroy() fails to destroy the phy
For devm_phy_destroy(), its comment says it needs to invoke phy_destroy() to destroy the phy, but it will not actually invoke the function since devres_destroy() does not call devm_phy_consume(), and the missing phy_destroy() call will cause that the phy fails to be destroyed. Fortunately, the faulty API has not been used by current kernel tree. Fix by using devres_release() instead of devres_destroy() within the API. Fixes: ff76496 ("drivers: phy: add generic PHY framework") Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent c0b82ab commit 4dc48c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/phy/phy-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ void devm_phy_destroy(struct device *dev, struct phy *phy)
11211121
{
11221122
int r;
11231123

1124-
r = devres_destroy(dev, devm_phy_consume, devm_phy_match, phy);
1124+
r = devres_release(dev, devm_phy_consume, devm_phy_match, phy);
11251125
dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
11261126
}
11271127
EXPORT_SYMBOL_GPL(devm_phy_destroy);

0 commit comments

Comments
 (0)