Skip to content

Commit ee02c1c

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
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]>
1 parent 9c9d5e9 commit ee02c1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-cros-ec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int cros_ec_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
193193
ret = cros_ec_pwm_get_duty(ec_pwm, pwm->hwpwm);
194194
if (ret < 0) {
195195
dev_err(chip->dev, "error getting initial duty: %d\n", ret);
196-
return 0;
196+
return ret;
197197
}
198198

199199
state->enabled = (ret > 0);

0 commit comments

Comments
 (0)