pwm: imx27: Propagate errors in .get_state() to the caller
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 2 Dec 2022 18:35:32 +0000 (19:35 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 6 Dec 2022 11:46:26 +0000 (12:46 +0100)
.get_state() can return an error indication. Make use of it to propagate
failing hardware accesses.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221130152148.2769768-8-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>
drivers/pwm/pwm-imx27.c

index 3a22c2f..29a3089 100644 (file)
@@ -128,7 +128,7 @@ static int pwm_imx27_get_state(struct pwm_chip *chip,
 
        ret = pwm_imx27_clk_prepare_enable(imx);
        if (ret < 0)
-               return 0;
+               return ret;
 
        val = readl(imx->mmio_base + MX3_PWMCR);