The Qualcomm DWC3 glue builds up a platform_device programmatically in
order to probe the DWC3 core when running off ACPI data. But with the
newly introduced support for instantiating the core directly from the
glue, this code can be replaced with a single function call.
@@ -942,7 +889,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
if (np)
ret = dwc3_qcom_of_register_core(pdev);
else
- ret = dwc3_qcom_acpi_register_core(pdev);
+ ret = dwc3_qcom_probe_core(pdev, qcom);
if (ret) {
dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret);
@@ -986,10 +933,10 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
interconnect_exit:
dwc3_qcom_interconnect_exit(qcom);
depopulate:
- if (np)
+ if (qcom->dwc_dev)
of_platform_depopulate(&pdev->dev);
else
- platform_device_put(pdev);
+ dwc3_remove(qcom->dwc);