Commit af06d009 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman

usb: host: ohci-pxa27x: 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 avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd90f73a
...@@ -274,14 +274,16 @@ extern void pxa27x_clear_otgph(void); ...@@ -274,14 +274,16 @@ extern void pxa27x_clear_otgph(void);
static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev) static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev)
{ {
int retval = 0; int retval;
struct pxaohci_platform_data *inf; struct pxaohci_platform_data *inf;
uint32_t uhchr; uint32_t uhchr;
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
inf = dev_get_platdata(dev); inf = dev_get_platdata(dev);
clk_prepare_enable(pxa_ohci->clk); retval = clk_prepare_enable(pxa_ohci->clk);
if (retval)
return retval;
pxa27x_reset_hc(pxa_ohci); pxa27x_reset_hc(pxa_ohci);
...@@ -296,8 +298,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev) ...@@ -296,8 +298,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev)
if (inf->init) if (inf->init)
retval = inf->init(dev); retval = inf->init(dev);
if (retval < 0) if (retval < 0) {
clk_disable_unprepare(pxa_ohci->clk);
return retval; return retval;
}
if (cpu_is_pxa3xx()) if (cpu_is_pxa3xx())
pxa3xx_u2d_start_hc(&hcd->self); pxa3xx_u2d_start_hc(&hcd->self);
......
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