diff options
| author | Andrew Goodbody <[email protected]> | 2025-10-21 17:08:30 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-12-04 09:38:17 -0600 |
| commit | ce219307a21fe7166b13542ba923ee09aef7f2f5 (patch) | |
| tree | 69f58de3e6d067852a9f757cc84abccd26215425 /drivers/timer | |
| parent | 40ad377c1619eb9b83d088a96f40b86a907c8c19 (diff) | |
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 <[email protected]>
Diffstat (limited to 'drivers/timer')
| -rw-r--r-- | drivers/timer/imx-gpt-timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |
