Skip to content

Commit

Permalink
usb: host: xhci-plat: add platform data support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Chen authored and gregkh committed Sep 20, 2020
1 parent 3732903 commit 46034a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/host/xhci-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 46034a9

Please sign in to comment.