pwm: rockchip: release clk if pinctrl check failed

Fixes: 718c02ce18 ("pwm: rockchip: Make pwm pinctrl setting after pwm enabled")
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ic67407ee416a24ba368c3cff21aefde0ddf63700
This commit is contained in:
Damon Ding 2023-02-15 18:00:22 +08:00 committed by Tao Huang
parent 1c4ec7310b
commit e5be89a49c

View File

@ -395,13 +395,15 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
pc->pinctrl = devm_pinctrl_get(&pdev->dev);
if (IS_ERR(pc->pinctrl)) {
dev_err(&pdev->dev, "Get pinctrl failed!\n");
return PTR_ERR(pc->pinctrl);
ret = PTR_ERR(pc->pinctrl);
goto err_pclk;
}
pc->active_state = pinctrl_lookup_state(pc->pinctrl, "active");
if (IS_ERR(pc->active_state)) {
dev_err(&pdev->dev, "No active pinctrl state\n");
return PTR_ERR(pc->active_state);
ret = PTR_ERR(pc->active_state);
goto err_pclk;
}
platform_set_drvdata(pdev, pc);