diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-11-24 18:02:11 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-25 15:47:05 +0100 |
commit | f415fbd17f0438913339fd043779f306ee3587b0 (patch) | |
tree | 05a66357e4eadba4db162af6ef734f0284ca94ee /drivers/usb/dwc2 | |
parent | usb: dwc2: Fix build warning when CONFIG_PM_SLEEP=n (diff) | |
download | linux-f415fbd17f0438913339fd043779f306ee3587b0.tar.xz linux-f415fbd17f0438913339fd043779f306ee3587b0.zip |
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>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/gadget.c | 10 |
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) hsotg->clk = devm_clk_get(dev, "otg"); if (IS_ERR(hsotg->clk)) { hsotg->clk = NULL; - dev_err(dev, "cannot get otg clock\n"); - return PTR_ERR(hsotg->clk); + dev_dbg(dev, "cannot get otg clock\n"); } hsotg->gadget.max_speed = USB_SPEED_HIGH; @@ -3461,7 +3460,12 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq) /* reset the system */ - clk_prepare_enable(hsotg->clk); + ret = clk_prepare_enable(hsotg->clk); + if (ret) { + dev_err(dev, "failed to enable otg clk\n"); + goto err_clk; + } + /* regulators */ |