mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
i2c: imx_lpi2c: 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> Reviewed-by: Heiko Schocher <hs@nabladev.com>
This commit is contained in:
parent
eb13583b9d
commit
40ad377c16
@ -304,7 +304,7 @@ static int bus_i2c_set_bus_speed(struct udevice *bus, int speed)
|
||||
|
||||
if (CONFIG_IS_ENABLED(CLK)) {
|
||||
clock_rate = clk_get_rate(&i2c_bus->per_clk);
|
||||
if (clock_rate <= 0) {
|
||||
if (!clock_rate || IS_ERR_VALUE(clock_rate)) {
|
||||
dev_err(bus, "Failed to get i2c clk: %d\n", clock_rate);
|
||||
return clock_rate;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user