mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
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:
committed by
Tom Rini
parent
40ad377c16
commit
ce219307a2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user