aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-lpss-platform.c
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2020-09-03 11:23:25 +0000
committerHans de Goede <[email protected]>2020-09-06 13:38:00 +0000
commit092d83e3f513a4a7b9f189b34e28b71c9edcedbd (patch)
tree8a9808bed2c83b65ce6dae2505d7e1dc0deeaae5 /drivers/pwm/pwm-lpss-platform.c
parentpwm: lpss: Add range limit check for the base_unit register value (diff)
downloadkernel-092d83e3f513a4a7b9f189b34e28b71c9edcedbd.tar.gz
kernel-092d83e3f513a4a7b9f189b34e28b71c9edcedbd.zip
pwm: lpss: Add pwm_lpss_prepare_enable() helper
In the not-enabled -> enabled path pwm_lpss_apply() needs to get a runtime-pm reference; and then on any errors it needs to release it again. This leads to somewhat hard to read code. This commit introduces a new pwm_lpss_prepare_enable() helper and moves all the steps necessary for the not-enabled -> enabled transition there, so that we can error check the entire transition in a single place and only have one pm_runtime_put() on failure call site. While working on this I noticed that the enabled -> enabled (update settings) path was quite similar, so I've added an enable parameter to the new pwm_lpss_prepare_enable() helper, which allows using it in that path too. Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/pwm/pwm-lpss-platform.c')
0 files changed, 0 insertions, 0 deletions