diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-12-02 19:35:31 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-12-06 12:46:25 +0100 |
commit | ee02c1cb87f957ff0c66337d776486e72967987d (patch) | |
tree | 716aeea1b63e208f47b5b3630686d4840c09b36f /drivers/pwm | |
parent | 9c9d5e9957ac443cc544d63688e2442c230430ea (diff) |
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.c | 2 |
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); |