From: Andrew Goodbody Date: Tue, 21 Oct 2025 16:08:30 +0000 (+0100) Subject: timer: imx-gpt: Fix error detection X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce219307a21fe7166b13542ba923ee09aef7f2f5;p=thirdparty%2Fu-boot.git 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 --- 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; }