From ce219307a21fe7166b13542ba923ee09aef7f2f5 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Tue, 21 Oct 2025 17:08:30 +0100 Subject: [PATCH] timer: imx-gpt: Fix error detection Testing an unisgned ivariable to be <= 0 will only detect the case when it is 0. So correct this error test to a working version that will behave as expected. Signed-off-by: Andrew Goodbody --- drivers/timer/imx-gpt-timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/timer/imx-gpt-timer.c b/drivers/timer/imx-gpt-timer.c index 07b9fdb5e18..7708d1ba17f 100644 --- a/drivers/timer/imx-gpt-timer.c +++ b/drivers/timer/imx-gpt-timer.c @@ -127,7 +127,7 @@ static int imx_gpt_timer_probe(struct udevice *dev) /* Get timer clock rate */ clk_rate = clk_get_rate(&clk); - if (clk_rate <= 0) { + if (!clk_rate || IS_ERR_VALUE(clk_rate)) { dev_err(dev, "Could not get clock rate...\n"); return -EINVAL; } -- 2.47.3