usb: ohci-at91: Check result of clk_enable()
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
fb1ff1794a
commit
bf09557360
|
@ -34,10 +34,23 @@ struct ohci_at91_priv {
|
||||||
struct ohci_regs __iomem *regs;
|
struct ohci_regs __iomem *regs;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void at91_start_clock(struct ohci_at91_priv *ohci_at91)
|
static int at91_start_clock(struct ohci_at91_priv *ohci_at91)
|
||||||
{
|
{
|
||||||
clk_enable(ohci_at91->iclk);
|
int ret;
|
||||||
clk_enable(ohci_at91->fclk);
|
|
||||||
|
ret = clk_enable(ohci_at91->iclk);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(ohci_at91->dev, "Failed to enable 'iclk'\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = clk_enable(ohci_at91->fclk);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(ohci_at91->dev, "Failed to enable 'fclk'\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void at91_stop_clock(struct ohci_at91_priv *ohci_at91)
|
static void at91_stop_clock(struct ohci_at91_priv *ohci_at91)
|
||||||
|
@ -48,6 +61,7 @@ static void at91_stop_clock(struct ohci_at91_priv *ohci_at91)
|
||||||
|
|
||||||
static int at91_ohci_probe(struct device_d *dev)
|
static int at91_ohci_probe(struct device_d *dev)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
struct resource *io;
|
struct resource *io;
|
||||||
struct ohci_at91_priv *ohci_at91 = xzalloc(sizeof(*ohci_at91));
|
struct ohci_at91_priv *ohci_at91 = xzalloc(sizeof(*ohci_at91));
|
||||||
|
|
||||||
|
@ -76,7 +90,9 @@ static int at91_ohci_probe(struct device_d *dev)
|
||||||
/*
|
/*
|
||||||
* Start the USB clocks.
|
* Start the USB clocks.
|
||||||
*/
|
*/
|
||||||
at91_start_clock(ohci_at91);
|
ret = at91_start_clock(ohci_at91);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The USB host controller must remain in reset.
|
* The USB host controller must remain in reset.
|
||||||
|
|
Loading…
Reference in New Issue