diff mbox series

pwm: ab8500: Fix error code in probe()

Message ID ffc1e98d-0db4-4b8a-9e49-eb87ef844cbd@kili.mountain
State Accepted
Delegated to: Thierry Reding
Headers show
Series pwm: ab8500: Fix error code in probe() | expand

Commit Message

Dan Carpenter May 22, 2023, 11:07 a.m. UTC
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>
---
 drivers/pwm/pwm-ab8500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij May 22, 2023, 1:35 p.m. UTC | #1
On Mon, May 22, 2023 at 1:07 PM Dan Carpenter <dan.carpenter@linaro.org> wrote:

> 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: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Uwe Kleine-König June 14, 2023, 6:30 a.m. UTC | #2
Hello Dan,

On Mon, May 22, 2023 at 02:07:42PM +0300, Dan Carpenter wrote:
> 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>

Thanks!

Best regards
Uwe
Thierry Reding June 23, 2023, 2:51 p.m. UTC | #3
On Mon, 22 May 2023 14:07:42 +0300, Dan Carpenter wrote:
> This code accidentally return positive EINVAL instead of negative
> -EINVAL.
> 
> 

Applied, thanks!

[1/1] pwm: ab8500: Fix error code in probe()
      commit: cdcffafc4d845cc0c6392cba168c7a942734cce7

Best regards,
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-ab8500.c b/drivers/pwm/pwm-ab8500.c
index 507ff0d5f7bd..583a7d69c741 100644
--- a/drivers/pwm/pwm-ab8500.c
+++ b/drivers/pwm/pwm-ab8500.c
@@ -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