aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-06-12 04:24:48 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-06-18 05:41:01 -0400
commit615277779f41a753e68f531613e344c54fdc95bf (patch)
tree595957b7106757b70f87aa24567efdcce7a39d05
parent6e967d7e2c4822eba4847ec09037119a0418aaef (diff)
usb: dwc3: Only call clk_bulk_get() on devicetree instantiated devices
Commit fe8abf332b8f ("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: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc3/core.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index ea91310113b9..103807587dc6 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev)
1272 if (!dwc->clks) 1272 if (!dwc->clks)
1273 return -ENOMEM; 1273 return -ENOMEM;
1274 1274
1275 dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
1276 dwc->dev = dev; 1275 dwc->dev = dev;
1277 1276
1278 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1277 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev)
1307 if (IS_ERR(dwc->reset)) 1306 if (IS_ERR(dwc->reset))
1308 return PTR_ERR(dwc->reset); 1307 return PTR_ERR(dwc->reset);
1309 1308
1310 ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks); 1309 if (dev->of_node) {
1311 if (ret == -EPROBE_DEFER) 1310 dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
1312 return ret; 1311
1313 /* 1312 ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks);
1314 * Clocks are optional, but new DT platforms should support all clocks 1313 if (ret == -EPROBE_DEFER)
1315 * as required by the DT-binding. 1314 return ret;
1316 */ 1315 /*
1317 if (ret) 1316 * Clocks are optional, but new DT platforms should support all
1318 dwc->num_clks = 0; 1317 * clocks as required by the DT-binding.
1318 */
1319 if (ret)
1320 dwc->num_clks = 0;
1321 }
1319 1322
1320 ret = reset_control_deassert(dwc->reset); 1323 ret = reset_control_deassert(dwc->reset);
1321 if (ret) 1324 if (ret)