summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2024-10-20 17:33:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-08 16:28:22 +0100
commitcd205590599a3e9ab3c73c6c80bcc0750729dce5 (patch)
tree3c7287f798249e5e1f5581a9deee3af93abff847 /drivers
parent53e0684f3093b2c081bff5a1cb6b1ca05c30625b (diff)
downloadlinux-cd205590599a3e9ab3c73c6c80bcc0750729dce5.tar.gz
linux-cd205590599a3e9ab3c73c6c80bcc0750729dce5.tar.bz2
linux-cd205590599a3e9ab3c73c6c80bcc0750729dce5.zip
usb: phy: Fix API devm_usb_put_phy() can not release the phy
commit fdce49b5da6e0fb6d077986dec3e90ef2b094b50 upstream. 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: cedf8602373a ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/phy/phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index 4b468bde19cf..5f6d711e7a8b 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -628,7 +628,7 @@ void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
{
int r;
- r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
+ r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
}
EXPORT_SYMBOL_GPL(devm_usb_put_phy);