aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2020-11-09 11:57:24 +0100
committerThierry Reding <thierry.reding@gmail.com>2020-12-17 14:18:48 +0100
commitd58560e6fa4611cee0630ef6e12544269563ca75 (patch)
tree47e1a13b2da6e7cfc4f30621b0381218c46e910b /drivers/pwm
parentpwm: ab8500: Explicitly allocate pwm chip base dynamically (diff)
downloadlinux-dev-d58560e6fa4611cee0630ef6e12544269563ca75.tar.xz
linux-dev-d58560e6fa4611cee0630ef6e12544269563ca75.zip
pwm: lpss: Log error from pwm_lpss_is_updating() if the update bit is still set
pwm_lpss_is_updating() does a sanity check which should never fail. If the check does actually fail that is worth logging an error, especially since this means that we will skip making the requested changes to the PWM settings. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-lpss.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
index 3444c56b4bed..939de93c157b 100644
--- a/drivers/pwm/pwm-lpss.c
+++ b/drivers/pwm/pwm-lpss.c
@@ -76,7 +76,12 @@ static int pwm_lpss_wait_for_update(struct pwm_device *pwm)
static inline int pwm_lpss_is_updating(struct pwm_device *pwm)
{
- return (pwm_lpss_read(pwm) & PWM_SW_UPDATE) ? -EBUSY : 0;
+ if (pwm_lpss_read(pwm) & PWM_SW_UPDATE) {
+ dev_err(pwm->chip->dev, "PWM_SW_UPDATE is still set, skipping update\n");
+ return -EBUSY;
+ }
+
+ return 0;
}
static void pwm_lpss_prepare(struct pwm_lpss_chip *lpwm, struct pwm_device *pwm,