clocksource/drivers/oxnas-rps: Fix irq_of_parse_and_map() return value
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 22 Apr 2022 10:41:01 +0000 (12:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:09 +0000 (18:36 +0200)
[ Upstream commit 9c04a8ff03def4df3f81219ffbe1ec9b44ff5348 ]

The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO.

Fixes: 89355274e1f7 ("clocksource/drivers/oxnas-rps: Add Oxford Semiconductor RPS Dual Timer")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220422104101.55754-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-oxnas-rps.c

index 56c0cc3..d514b44 100644 (file)
@@ -236,7 +236,7 @@ static int __init oxnas_rps_timer_init(struct device_node *np)
        }
 
        rps->irq = irq_of_parse_and_map(np, 0);
-       if (rps->irq < 0) {
+       if (!rps->irq) {
                ret = -EINVAL;
                goto err_iomap;
        }