Commit 0e1b89e5 authored by Arvind Yadav's avatar Arvind Yadav Committed by Felipe Balbi

usb: gadget: mv_udc: Handle return value of clk_prepare_enable.

clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 46b780d4
...@@ -960,9 +960,9 @@ static const struct usb_ep_ops mv_ep_ops = { ...@@ -960,9 +960,9 @@ static const struct usb_ep_ops mv_ep_ops = {
.fifo_flush = mv_ep_fifo_flush, /* flush fifo */ .fifo_flush = mv_ep_fifo_flush, /* flush fifo */
}; };
static void udc_clock_enable(struct mv_udc *udc) static int udc_clock_enable(struct mv_udc *udc)
{ {
clk_prepare_enable(udc->clk); return clk_prepare_enable(udc->clk);
} }
static void udc_clock_disable(struct mv_udc *udc) static void udc_clock_disable(struct mv_udc *udc)
...@@ -1070,7 +1070,10 @@ static int mv_udc_enable_internal(struct mv_udc *udc) ...@@ -1070,7 +1070,10 @@ static int mv_udc_enable_internal(struct mv_udc *udc)
return 0; return 0;
dev_dbg(&udc->dev->dev, "enable udc\n"); dev_dbg(&udc->dev->dev, "enable udc\n");
udc_clock_enable(udc); retval = udc_clock_enable(udc);
if (retval)
return retval;
if (udc->pdata->phy_init) { if (udc->pdata->phy_init) {
retval = udc->pdata->phy_init(udc->phy_regs); retval = udc->pdata->phy_init(udc->phy_regs);
if (retval) { if (retval) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment