提交 61527777 编写于 作者: H Hans de Goede 提交者: Felipe Balbi

usb: dwc3: Only call clk_bulk_get() on devicetree instantiated devices

Commit fe8abf33 ("usb: dwc3: support clocks and resets for DWC3 core")
adds support for handling clocks and resets in the DWC3 core, so that for
platforms following the standard devicetree bindings this does not need
to be duplicated in all the different glue layers.

These changes intended for devicetree based platforms introduce an
uncoditional clk_bulk_get() in the core probe path. This leads to the
following error being logged on x86/ACPI systems:

[   26.276783] dwc3 dwc3.3.auto: Failed to get clk 'ref': -2

This commits wraps the clk_bulk_get() in an if (dev->of_node) check so
that it only is done on devicetree instantiated devices, fixing this
error.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 6e967d7e
...@@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev)
if (!dwc->clks) if (!dwc->clks)
return -ENOMEM; return -ENOMEM;
dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
dwc->dev = dev; dwc->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev) ...@@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev)
if (IS_ERR(dwc->reset)) if (IS_ERR(dwc->reset))
return PTR_ERR(dwc->reset); return PTR_ERR(dwc->reset);
if (dev->of_node) {
dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks);
if (ret == -EPROBE_DEFER) if (ret == -EPROBE_DEFER)
return ret; return ret;
/* /*
* Clocks are optional, but new DT platforms should support all clocks * Clocks are optional, but new DT platforms should support all
* as required by the DT-binding. * clocks as required by the DT-binding.
*/ */
if (ret) if (ret)
dwc->num_clks = 0; dwc->num_clks = 0;
}
ret = reset_control_deassert(dwc->reset); ret = reset_control_deassert(dwc->reset);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册