From 27dfd22242063b698ed1df16ad9d80a84ae9f8d5 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Thu, 20 Aug 2020 17:27:09 +0800 Subject: [PATCH] MLK-24527-5 usb: dwc3: host: pass xhci_plat_priv to xhci plat Since dwc3 glue layer may have its xhci_plat_priv, so pass to xhci plat driver to handle it. Reviewed-by: Peter Chen Signed-off-by: Li Jun (cherry picked from commit 38f26c0e7ddb9190de2e21fc927ca0567b9ceaea) --- drivers/usb/dwc3/host.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index 05047911a884..b71c5b828b71 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -89,6 +89,7 @@ int dwc3_host_init(struct dwc3 *dwc) int ret, irq; struct resource *res; struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); + struct dwc3_platform_data *dwc3_pdata; int prop_idx = 0; /* @@ -161,6 +162,14 @@ int dwc3_host_init(struct dwc3 *dwc) } } + dwc3_pdata = (struct dwc3_platform_data *)dev_get_platdata(dwc->dev); + if (dwc3_pdata && dwc3_pdata->xhci_priv) { + ret = platform_device_add_data(xhci, dwc3_pdata->xhci_priv, + sizeof(struct xhci_plat_priv)); + if (ret) + goto err; + } + ret = platform_device_add(xhci); if (ret) { dev_err(dwc->dev, "failed to register xHCI device\n");