diff options
author | Johan Hovold <johan@kernel.org> | 2017-07-20 06:48:17 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2017-08-21 02:11:26 -0400 |
commit | e2b5602af76dec75f474e4173afb4215007ecfa5 (patch) | |
tree | a6925922eef953f6d8c3062bd776ae4d65b66b9f /drivers/pwm/pwm-tiehrpwm.c | |
parent | c7fdd3f52944b81d807ce7a5fde7d1ca8a2a0919 (diff) |
pwm: tiehrpwm: fix clock imbalance in probe error path
Make sure to unprepare the clock before returning on late probe errors.
Fixes: b388f15fd14c ("pwm: pwm-tiehrpwm: Use clk_enable/disable instead clk_prepare/unprepare.")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-tiehrpwm.c')
-rw-r--r-- | drivers/pwm/pwm-tiehrpwm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c index 6e51a075d1a7..387eaf1bac85 100644 --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c | |||
@@ -489,13 +489,18 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev) | |||
489 | ret = pwmchip_add(&pc->chip); | 489 | ret = pwmchip_add(&pc->chip); |
490 | if (ret < 0) { | 490 | if (ret < 0) { |
491 | dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); | 491 | dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); |
492 | return ret; | 492 | goto err_clk_unprepare; |
493 | } | 493 | } |
494 | 494 | ||
495 | pm_runtime_enable(&pdev->dev); | 495 | pm_runtime_enable(&pdev->dev); |
496 | 496 | ||
497 | platform_set_drvdata(pdev, pc); | 497 | platform_set_drvdata(pdev, pc); |
498 | return 0; | 498 | return 0; |
499 | |||
500 | err_clk_unprepare: | ||
501 | clk_unprepare(pc->tbclk); | ||
502 | |||
503 | return ret; | ||
499 | } | 504 | } |
500 | 505 | ||
501 | static int ehrpwm_pwm_remove(struct platform_device *pdev) | 506 | static int ehrpwm_pwm_remove(struct platform_device *pdev) |