pwm: tiehrpwm: fix clock imbalance in probe error path

Make sure to unprepare the clock before returning on late probe errors.

Fixes: b388f15fd1 ("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>
This commit is contained in:
Johan Hovold 2017-07-20 12:48:17 +02:00 коммит произвёл Thierry Reding
Родитель c7fdd3f529
Коммит e2b5602af7
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -489,13 +489,18 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&pc->chip); ret = pwmchip_add(&pc->chip);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
return ret; goto err_clk_unprepare;
} }
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
platform_set_drvdata(pdev, pc); platform_set_drvdata(pdev, pc);
return 0; return 0;
err_clk_unprepare:
clk_unprepare(pc->tbclk);
return ret;
} }
static int ehrpwm_pwm_remove(struct platform_device *pdev) static int ehrpwm_pwm_remove(struct platform_device *pdev)