Skip to content

Commit

Permalink
pwm: lpss: Log error from pwm_lpss_is_updating() if the update bit is…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Hans de Goede authored and Thierry Reding committed Dec 17, 2020
1 parent 5e5da1e commit d58560e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pwm/pwm-lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d58560e

Please sign in to comment.