summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2022-12-02 21:35:31 +0300
committerThierry Reding <thierry.reding@gmail.com>2022-12-06 14:46:25 +0300
commitee02c1cb87f957ff0c66337d776486e72967987d (patch)
tree716aeea1b63e208f47b5b3630686d4840c09b36f /drivers/pwm
parent9c9d5e9957ac443cc544d63688e2442c230430ea (diff)
downloadlinux-ee02c1cb87f957ff0c66337d776486e72967987d.tar.xz
pwm: cros-ec: Propagate errors in .get_state() to the caller
.get_state() can return an error indication. Make use of it to propagate failing hardware accesses. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20221130152148.2769768-7-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-cros-ec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-cros-ec.c b/drivers/pwm/pwm-cros-ec.c
index 11684edc0620..86df6702cb83 100644
--- a/drivers/pwm/pwm-cros-ec.c
+++ b/drivers/pwm/pwm-cros-ec.c
@@ -193,7 +193,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
ret = cros_ec_pwm_get_duty(ec_pwm, pwm->hwpwm);
if (ret < 0) {
dev_err(chip->dev, "error getting initial duty: %d\n", ret);
- return 0;
+ return ret;
}
state->enabled = (ret > 0);