Also return proper error in tegra_pwm_remove() if pwmchip_remove()
fails.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
platform_set_drvdata(pdev, pwm);
- pwm->clk = clk_get(&pdev->dev, NULL);
+ pwm->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pwm->clk))
return PTR_ERR(pwm->clk);
ret = pwmchip_add(&pwm->chip);
if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
- clk_put(pwm->clk);
return ret;
}
clk_disable_unprepare(pc->clk);
}
- pwmchip_remove(&pc->chip);
- clk_put(pc->clk);
-
- return 0;
+ return pwmchip_remove(&pc->chip);
}
#ifdef CONFIG_OF