diff options
| author | Uwe Kleine-König <[email protected]> | 2022-12-02 18:35:31 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2022-12-06 11:46:25 +0000 |
| commit | ee02c1cb87f957ff0c66337d776486e72967987d (patch) | |
| tree | 716aeea1b63e208f47b5b3630686d4840c09b36f /drivers/pwm/pwm-cros-ec.c | |
| parent | pwm: crc: Propagate errors in .get_state() to the caller (diff) | |
| download | kernel-ee02c1cb87f957ff0c66337d776486e72967987d.tar.gz kernel-ee02c1cb87f957ff0c66337d776486e72967987d.zip | |
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 <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-cros-ec.c')
| -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); |
