Skip to content

Commit

Permalink
pwm: vt8500: Only unprepare the clock after the pwmchip was removed
Browse files Browse the repository at this point in the history
Until pwmchip_remove() returns the PWM is supposed to work, so
pwmchip_remove() must be called before the clock is stopped.

The return value of pwmchip_remove doesn't need to be checked because
it returns zero anyhow and I plan to make it return void soon.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Uwe Kleine-König authored and Thierry Reding committed Jun 30, 2021
1 parent fb2cb3b commit 868f13b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pwm/pwm-vt8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,11 @@ static int vt8500_pwm_remove(struct platform_device *pdev)
{
struct vt8500_chip *chip = platform_get_drvdata(pdev);

pwmchip_remove(&chip->chip);

clk_unprepare(chip->clk);

return pwmchip_remove(&chip->chip);
return 0;
}

static struct platform_driver vt8500_pwm_driver = {
Expand Down

0 comments on commit 868f13b

Please sign in to comment.