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 <andrew.goodbody@linaro.org>
This commit is contained in:
Andrew Goodbody
2025-10-21 17:08:30 +01:00
committed by Tom Rini
parent 40ad377c16
commit ce219307a2

View File

@@ -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;
}