aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinh Nguyen <dinguyen@opensource.altera.com>2014-11-24 12:02:11 -0500
committerFelipe Balbi <balbi@ti.com>2014-11-25 09:47:05 -0500
commitf415fbd17f0438913339fd043779f306ee3587b0 (patch)
tree05a66357e4eadba4db162af6ef734f0284ca94ee
parentda9f3289c74f93b63c5ca741caa4e2d728ccafba (diff)
usb: dwc2: remove early return on clock query
Since we have assigned clk=NULL, which is a valid clk, we should not be returning when a clock node is not provide. Instead, we should return only when we cannot enable the clock. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/dwc2/gadget.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 05b05221d677..407f55cf83aa 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3451,8 +3451,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
3451 hsotg->clk = devm_clk_get(dev, "otg"); 3451 hsotg->clk = devm_clk_get(dev, "otg");
3452 if (IS_ERR(hsotg->clk)) { 3452 if (IS_ERR(hsotg->clk)) {
3453 hsotg->clk = NULL; 3453 hsotg->clk = NULL;
3454 dev_err(dev, "cannot get otg clock\n"); 3454 dev_dbg(dev, "cannot get otg clock\n");
3455 return PTR_ERR(hsotg->clk);
3456 } 3455 }
3457 3456
3458 hsotg->gadget.max_speed = USB_SPEED_HIGH; 3457 hsotg->gadget.max_speed = USB_SPEED_HIGH;
@@ -3461,7 +3460,12 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
3461 3460
3462 /* reset the system */ 3461 /* reset the system */
3463 3462
3464 clk_prepare_enable(hsotg->clk); 3463 ret = clk_prepare_enable(hsotg->clk);
3464 if (ret) {
3465 dev_err(dev, "failed to enable otg clk\n");
3466 goto err_clk;
3467 }
3468
3465 3469
3466 /* regulators */ 3470 /* regulators */
3467 3471