pwm: imx: Signedness bug in imx_pwm_get_state()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Jan 2019 08:27:47 +0000 (11:27 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 16 Jan 2019 07:45:38 +0000 (08:45 +0100)
"ret" only holds zero and negative error codes.  It needs to be signed
for the error handling to work.

Fixes: 9f4c8f9607c3 ("pwm: imx: Add ipg clock operation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-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 8b8b1c6..55666cc 100644 (file)
@@ -115,8 +115,9 @@ static void pwm_imx27_get_state(struct pwm_chip *chip,
                                struct pwm_device *pwm, struct pwm_state *state)
 {
        struct pwm_imx27_chip *imx = to_pwm_imx27_chip(chip);
-       u32 period, prescaler, pwm_clk, ret, val;
+       u32 period, prescaler, pwm_clk, val;
        u64 tmp;
+       int ret;
 
        ret = pwm_imx27_clk_prepare_enable(chip);
        if (ret < 0)