diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 772482129149..550ad95cc71c 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -4115,9 +4115,6 @@ static int dwc3_msm_remove(struct platform_device *pdev) mdwc->dpdm_nb.notifier_call = NULL; } - if (mdwc->usb_psy) - power_supply_put(mdwc->usb_psy); - /* * In case of system suspend, pm_runtime_get_sync fails. * Hence turn ON the clocks manually. @@ -4527,7 +4524,7 @@ static int dwc3_msm_gadget_vbus_draw(struct dwc3_msm *mdwc, unsigned int mA) int ret; if (!mdwc->usb_psy) { - mdwc->usb_psy = power_supply_get_by_phandle(mdwc->dev->of_node, + mdwc->usb_psy = devm_power_supply_get_by_phandle(mdwc->dev, "qcom,usb-charger"); if (IS_ERR_OR_NULL(mdwc->usb_psy)) { dev_info(mdwc->dev, "Could not get usb psy\n");