pwm: ab8500: Fix error code in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 22 May 2023 11:07:42 +0000 (14:07 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 23 Jun 2023 13:43:49 +0000 (15:43 +0200)
This code accidentally return positive EINVAL instead of negative
-EINVAL.

Fixes: eb41f334589d ("pwm: ab8500: Fix register offset calculation to not depend on probe order")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-ab8500.c

index 507ff0d..583a7d6 100644 (file)
@@ -190,7 +190,7 @@ static int ab8500_pwm_probe(struct platform_device *pdev)
        int err;
 
        if (pdev->id < 1 || pdev->id > 31)
-               return dev_err_probe(&pdev->dev, EINVAL, "Invalid device id %d\n", pdev->id);
+               return dev_err_probe(&pdev->dev, -EINVAL, "Invalid device id %d\n", pdev->id);
 
        /*
         * Nothing to be done in probe, this is required to get the