Commit 6813463c authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD Committed by Nicolas Ferre

USB: at91: fix clk_get error handling

Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Cc: linux-usb@vger.kernel.org
parent 08a52e1b
...@@ -139,8 +139,23 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, ...@@ -139,8 +139,23 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
} }
iclk = clk_get(&pdev->dev, "ohci_clk"); iclk = clk_get(&pdev->dev, "ohci_clk");
if (IS_ERR(iclk)) {
dev_err(&pdev->dev, "failed to get ohci_clk\n");
retval = PTR_ERR(iclk);
goto err3;
}
fclk = clk_get(&pdev->dev, "uhpck"); fclk = clk_get(&pdev->dev, "uhpck");
if (IS_ERR(fclk)) {
dev_err(&pdev->dev, "failed to get uhpck\n");
retval = PTR_ERR(fclk);
goto err4;
}
hclk = clk_get(&pdev->dev, "hclk"); hclk = clk_get(&pdev->dev, "hclk");
if (IS_ERR(hclk)) {
dev_err(&pdev->dev, "failed to get hclk\n");
retval = PTR_ERR(hclk);
goto err5;
}
at91_start_hc(pdev); at91_start_hc(pdev);
ohci_hcd_init(hcd_to_ohci(hcd)); ohci_hcd_init(hcd_to_ohci(hcd));
...@@ -153,9 +168,12 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, ...@@ -153,9 +168,12 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
at91_stop_hc(pdev); at91_stop_hc(pdev);
clk_put(hclk); clk_put(hclk);
err5:
clk_put(fclk); clk_put(fclk);
err4:
clk_put(iclk); clk_put(iclk);
err3:
iounmap(hcd->regs); iounmap(hcd->regs);
err2: err2:
......
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