Skip to content

Commit 9c9d5e9

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: crc: Propagate errors in .get_state() to the caller
.get_state() can return an error indication. Make use of it to propagate failing hardware accesses. 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 fea768c commit 9c9d5e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pwm/pwm-crc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ static int crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
132132
error = regmap_read(crc_pwm->regmap, PWM0_CLK_DIV, &clk_div_reg);
133133
if (error) {
134134
dev_err(dev, "Error reading PWM0_CLK_DIV %d\n", error);
135-
return 0;
135+
return error;
136136
}
137137

138138
error = regmap_read(crc_pwm->regmap, PWM0_DUTY_CYCLE, &duty_cycle_reg);
139139
if (error) {
140140
dev_err(dev, "Error reading PWM0_DUTY_CYCLE %d\n", error);
141-
return 0;
141+
return error;
142142
}
143143

144144
clk_div = (clk_div_reg & ~PWM_OUTPUT_ENABLE) + 1;

0 commit comments

Comments
 (0)