diff options
author | Magnus Damm <damm@opensource.se> | 2012-12-14 00:53:32 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-03-12 13:24:35 -0400 |
commit | 2fd61b32764c82b8410a4374d0ab3ec418ce37c7 (patch) | |
tree | 5ac1e9e3a3faca93810d4baa6378ffb94ddb7162 /drivers/clocksource | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
clocksource: sh_cmt: Take care of clk_put() when setup_irq() fails
Make sure clk_put() is called in case of failure in sh_cmt_setup().
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r-- | drivers/clocksource/sh_cmt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 488c14cc8dbf..4b8d2962cad7 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c | |||
@@ -708,17 +708,19 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev) | |||
708 | cfg->clocksource_rating); | 708 | cfg->clocksource_rating); |
709 | if (ret) { | 709 | if (ret) { |
710 | dev_err(&p->pdev->dev, "registration failed\n"); | 710 | dev_err(&p->pdev->dev, "registration failed\n"); |
711 | goto err1; | 711 | goto err2; |
712 | } | 712 | } |
713 | p->cs_enabled = false; | 713 | p->cs_enabled = false; |
714 | 714 | ||
715 | ret = setup_irq(irq, &p->irqaction); | 715 | ret = setup_irq(irq, &p->irqaction); |
716 | if (ret) { | 716 | if (ret) { |
717 | dev_err(&p->pdev->dev, "failed to request irq %d\n", irq); | 717 | dev_err(&p->pdev->dev, "failed to request irq %d\n", irq); |
718 | goto err1; | 718 | goto err2; |
719 | } | 719 | } |
720 | 720 | ||
721 | return 0; | 721 | return 0; |
722 | err2: | ||
723 | clk_put(p->clk); | ||
722 | 724 | ||
723 | err1: | 725 | err1: |
724 | iounmap(p->mapbase); | 726 | iounmap(p->mapbase); |