summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-plat.c
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-09-18 16:17:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-20 17:18:00 +0300
commit46034a999c07fff750deb44d1bf5161e8c63646e (patch)
tree20fb2bc574f4bbf437c94f94002a5e676066e1fa /drivers/usb/host/xhci-plat.c
parent37329036f67f2592a01c62fcc33b13dd55c42140 (diff)
downloadlinux-46034a999c07fff750deb44d1bf5161e8c63646e.tar.xz
usb: host: xhci-plat: add platform data support
Some xhci hosts (eg dwc3 and cdns3) do not use OF to create platform device, they create xhci-plat platform device runtime. And these platforms may also have quirks, and the quirks could be supplied by their parent device through platform data. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200918131752.16488-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-plat.c')
-rw-r--r--drivers/usb/host/xhci-plat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 3057cfc76d6a..c7f98edc5678 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -264,7 +264,11 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (ret)
goto disable_reg_clk;
- priv_match = of_device_get_match_data(&pdev->dev);
+ if (pdev->dev.of_node)
+ priv_match = of_device_get_match_data(&pdev->dev);
+ else
+ priv_match = dev_get_platdata(&pdev->dev);
+
if (priv_match) {
struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd);