]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: renesas_usbhs: Use devm_usb_get_phy()
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tue, 25 Feb 2025 11:02:47 +0000 (13:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Mar 2025 09:20:11 +0000 (10:20 +0100)
The gpriv->transceiver is retrieved in probe() through usb_get_phy() but
never released. Use devm_usb_get_phy() to handle this scenario.

This issue was identified through code investigation. No issue was found
without this change.

Fixes: b5a2875605ca ("usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS")
Cc: stable <stable@kernel.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://lore.kernel.org/r/20250225110248.870417-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/renesas_usbhs/mod_gadget.c

index 105132ae87acbcc33241bdb2b75601a60fbbd6f4..e8e5723f541226854656f00273dec572a45b9151 100644 (file)
@@ -1094,7 +1094,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
                goto usbhs_mod_gadget_probe_err_gpriv;
        }
 
-       gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED);
+       gpriv->transceiver = devm_usb_get_phy(dev, USB_PHY_TYPE_UNDEFINED);
        dev_info(dev, "%stransceiver found\n",
                 !IS_ERR(gpriv->transceiver) ? "" : "no ");