pwm: Restore initial state if a legacy callback fails
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 1 Jul 2021 07:29:27 +0000 (09:29 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 17 Nov 2021 16:10:42 +0000 (17:10 +0100)
commite45a178e9e285c86265611a56705a1e6444037e3
treef4eb0ef63878f0caee9b8331df924a94f6d63882
parent92f69e582e15bf281ff1ab3ccc7abdd8392550a3
pwm: Restore initial state if a legacy callback fails

It is not entirely accurate to go back to the initial state after e.g.
.enable() failed, as .config() still modified the hardware, but this same
inconsistency exists for drivers that implement .apply().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c