Commit baffab28 authored by Simon Baatz's avatar Simon Baatz Committed by Andrew Lunn

ARM: Orion: fix driver probe error handling with respect to clk

The clk patches added code to get and enable clocks in the
respective driver probe functions.  If the probe function failed
for some reason after enabling the clock, the clock was not
disabled again in many cases.
Signed-off-by: default avatarSimon Baatz <gmbnomis@gmail.com>
Signed-off-by: default avatarAndrew Lumm <andrew@lunn.ch>
parent 30e0f580
...@@ -1098,6 +1098,10 @@ static int mv_probe(struct platform_device *pdev) ...@@ -1098,6 +1098,10 @@ static int mv_probe(struct platform_device *pdev)
crypto_unregister_alg(&mv_aes_alg_ecb); crypto_unregister_alg(&mv_aes_alg_ecb);
err_irq: err_irq:
free_irq(irq, cp); free_irq(irq, cp);
if (!IS_ERR(cp->clk)) {
clk_disable_unprepare(cp->clk);
clk_put(cp->clk);
}
err_thread: err_thread:
kthread_stop(cp->queue_th); kthread_stop(cp->queue_th);
err_unmap_sram: err_unmap_sram:
......
...@@ -839,6 +839,10 @@ static int __init mvsd_probe(struct platform_device *pdev) ...@@ -839,6 +839,10 @@ static int __init mvsd_probe(struct platform_device *pdev)
if (r) if (r)
release_resource(r); release_resource(r);
if (mmc) if (mmc)
if (!IS_ERR_OR_NULL(host->clk)) {
clk_disable_unprepare(host->clk);
clk_put(host->clk);
}
mmc_free_host(mmc); mmc_free_host(mmc);
return ret; return ret;
......
...@@ -183,6 +183,10 @@ static int __init orion_nand_probe(struct platform_device *pdev) ...@@ -183,6 +183,10 @@ static int __init orion_nand_probe(struct platform_device *pdev)
return 0; return 0;
no_dev: no_dev:
if (!IS_ERR(clk)) {
clk_disable_unprepare(clk);
clk_put(clk);
}
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
iounmap(io_base); iounmap(io_base);
no_res: no_res:
......
...@@ -2983,6 +2983,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev) ...@@ -2983,6 +2983,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
return 0; return 0;
out: out:
#if defined(CONFIG_HAVE_CLK)
if (!IS_ERR(mp->clk)) {
clk_disable_unprepare(mp->clk);
clk_put(mp->clk);
}
#endif
free_netdev(dev); free_netdev(dev);
return err; return err;
......
...@@ -298,6 +298,10 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev) ...@@ -298,6 +298,10 @@ static int __devinit ehci_orion_drv_probe(struct platform_device *pdev)
err4: err4:
usb_put_hcd(hcd); usb_put_hcd(hcd);
err3: err3:
if (!IS_ERR(clk)) {
clk_disable_unprepare(clk);
clk_put(clk);
}
iounmap(regs); iounmap(regs);
err2: err2:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
......
...@@ -458,7 +458,13 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev) ...@@ -458,7 +458,13 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)
} }
clk_prepare_enable(priv->clk); clk_prepare_enable(priv->clk);
return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai); err = snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai);
if (!err)
return 0;
dev_err(&pdev->dev, "snd_soc_register_dai failed\n");
clk_disable_unprepare(priv->clk);
clk_put(priv->clk);
err_ioremap: err_ioremap:
iounmap(priv->io); iounmap(priv->io);
......
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