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