mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-19 16:31:27 +01:00
i2c: npcm: Fix error detection
Testing an unisgned member of a struct 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> Reviewed-by: Heiko Schocher <hs@nabladev.com>
This commit is contained in:
parent
ae4f60801f
commit
eb13583b9d
@ -573,7 +573,7 @@ static int npcm_i2c_probe(struct udevice *dev)
|
||||
return ret;
|
||||
}
|
||||
bus->apb_clk = clk_get_rate(&clk);
|
||||
if (bus->apb_clk <= 0) {
|
||||
if (!bus->apb_clk || IS_ERR_VALUE(bus->apb_clk)) {
|
||||
printf("%s: fail to get rate\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user