Skip to content

Commit fdce49b

Browse files
zijun-hugregkh
authored andcommitted
usb: phy: Fix API devm_usb_put_phy() can not release the phy
For devm_usb_put_phy(), its comment says it needs to invoke usb_put_phy() to release the phy, but it does not do that actually, so it can not fully undo what the API devm_usb_get_phy() does, that is wrong, fixed by using devres_release() instead of devres_destroy() within the API. Fixes: cedf860 ("usb: phy: move bulk of otg/otg.c to phy/phy.c") Cc: stable@vger.kernel.org Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://lore.kernel.org/r/20241020-usb_phy_fix-v1-1-7f79243b8e1e@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1ab0b9a commit fdce49b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/phy/phy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
628628
{
629629
int r;
630630

631-
r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
631+
r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
632632
dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
633633
}
634634
EXPORT_SYMBOL_GPL(devm_usb_put_phy);

0 commit comments

Comments
 (0)