diff options
| author | Jack Pham <jackp@codeaurora.org> | 2016-02-01 23:40:27 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:06:02 -0700 |
| commit | 3eab96eff74e35f831768403315a25373a7f8e5c (patch) | |
| tree | 1f3a241e7c3335874b6fbffa5006170f745b83b4 /drivers | |
| parent | 37b653ba0409347775fbc7c9f112cf816d821c97 (diff) | |
usb: dwc3-msm: Compilation fixups for 4.4
This patch includes a couple of fixups to compile against
recent kernels:
- replace CONFIG_PM_RUNTIME with CONFIG_PM
- replace of_usb_get_dr_mode() with usb_get_dr_mode(). As a result
it needs to be called after of_find_device_by_node()
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/dwc3/dwc3-msm.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 425745d9e764..9a2b32820e48 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -2585,7 +2585,6 @@ static int dwc3_msm_probe(struct platform_device *pdev) struct dwc3 *dwc; struct resource *res; void __iomem *tcsr; - unsigned long flags; bool host_mode; int ret = 0; int ext_hub_reset_gpio; @@ -2831,7 +2830,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) dwc3_set_notifier(&dwc3_msm_notify_event); - /* Assumes dwc3 is the only DT child of dwc3-msm */ + /* Assumes dwc3 is the first DT child of dwc3-msm */ dwc3_node = of_get_next_available_child(node, NULL); if (!dwc3_node) { dev_err(&pdev->dev, "failed to find dwc3 child\n"); @@ -2839,7 +2838,22 @@ static int dwc3_msm_probe(struct platform_device *pdev) goto err; } - host_mode = of_usb_get_dr_mode(dwc3_node) == USB_DR_MODE_HOST; + ret = of_platform_populate(node, NULL, NULL, &pdev->dev); + if (ret) { + dev_err(&pdev->dev, + "failed to add create dwc3 core\n"); + of_node_put(dwc3_node); + goto err; + } + + mdwc->dwc3 = of_find_device_by_node(dwc3_node); + of_node_put(dwc3_node); + if (!mdwc->dwc3) { + dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); + goto put_dwc3; + } + + host_mode = usb_get_dr_mode(&mdwc->dwc3->dev) == USB_DR_MODE_HOST; /* usb_psy required only for vbus_notifications */ if (!host_mode) { mdwc->usb_psy.name = "usb"; @@ -2864,21 +2878,6 @@ static int dwc3_msm_probe(struct platform_device *pdev) } } - ret = of_platform_populate(node, NULL, NULL, &pdev->dev); - if (ret) { - dev_err(&pdev->dev, - "failed to add create dwc3 core\n"); - of_node_put(dwc3_node); - goto put_psupply; - } - - mdwc->dwc3 = of_find_device_by_node(dwc3_node); - of_node_put(dwc3_node); - if (!mdwc->dwc3) { - dev_err(&pdev->dev, "failed to get dwc3 platform device\n"); - goto put_dwc3; - } - mdwc->hs_phy = devm_usb_get_phy_by_phandle(&mdwc->dwc3->dev, "usb-phy", 0); if (IS_ERR(mdwc->hs_phy)) { @@ -3658,7 +3657,7 @@ static int dwc3_msm_pm_resume(struct device *dev) } #endif -#ifdef CONFIG_PM_RUNTIME +#ifdef CONFIG_PM static int dwc3_msm_runtime_idle(struct device *dev) { dev_dbg(dev, "DWC3-msm runtime idle\n"); |
