diff options
| author | Uwe Kleine-König <[email protected]> | 2022-12-02 18:35:30 +0000 |
|---|---|---|
| committer | Thierry Reding <[email protected]> | 2022-12-06 11:46:25 +0000 |
| commit | 9c9d5e9957ac443cc544d63688e2442c230430ea (patch) | |
| tree | a812a7b9a7ba71b9c8aa4ef16ada07265fcdb682 /drivers/pwm/pwm-crc.c | |
| parent | leds: qcom-lpg: Propagate errors in .get_state() to the caller (diff) | |
| download | kernel-9c9d5e9957ac443cc544d63688e2442c230430ea.tar.gz kernel-9c9d5e9957ac443cc544d63688e2442c230430ea.zip | |
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]>
Diffstat (limited to 'drivers/pwm/pwm-crc.c')
| -rw-r--r-- | drivers/pwm/pwm-crc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-crc.c b/drivers/pwm/pwm-crc.c index 4099850117ba..4703b4a0b6e4 100644 --- a/drivers/pwm/pwm-crc.c +++ b/drivers/pwm/pwm-crc.c @@ -132,13 +132,13 @@ static int crc_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, error = regmap_read(crc_pwm->regmap, PWM0_CLK_DIV, &clk_div_reg); if (error) { dev_err(dev, "Error reading PWM0_CLK_DIV %d\n", error); - return 0; + return error; } error = regmap_read(crc_pwm->regmap, PWM0_DUTY_CYCLE, &duty_cycle_reg); if (error) { dev_err(dev, "Error reading PWM0_DUTY_CYCLE %d\n", error); - return 0; + return error; } clk_div = (clk_div_reg & ~PWM_OUTPUT_ENABLE) + 1; |
