[PATCH 0/6] clk: Fix some error detection

Andrew Goodbody andrew.goodbody at linaro.org
Tue Oct 21 18:08:24 CEST 2025


The function clk_get_rate() returns a ulong with 0 meaning an invalid
clock rate and also negative error codes being returned for other
errors. But being an unsigned return value this cannot simply be tested
for with a < 0 test. Instead use the IS_ERR_VALUE() macro to check for
negative errors appearing as very large positive values. Fix those
places that test for <= 0. Also fix some places checking the return of
clk_register() that incorrectly used ERR_PTR().

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
Andrew Goodbody (6):
      mmc: hi6220_dw_mmc: Fix error detection for clk_get_rate
      mmc: fsl_esdhc_imx: Cannot test unsigned to be < 0
      clk: microchip: mpfs: Fix error detection
      i2c: npcm: Fix error detection
      i2c: imx_lpi2c: Fix error detection
      timer: imx-gpt: Fix error detection

 drivers/clk/microchip/mpfs_clk_cfg.c    | 2 +-
 drivers/clk/microchip/mpfs_clk_msspll.c | 2 +-
 drivers/clk/microchip/mpfs_clk_periph.c | 2 +-
 drivers/i2c/imx_lpi2c.c                 | 2 +-
 drivers/i2c/npcm_i2c.c                  | 2 +-
 drivers/mmc/fsl_esdhc_imx.c             | 2 +-
 drivers/mmc/hi6220_dw_mmc.c             | 6 +++---
 drivers/timer/imx-gpt-timer.c           | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
---
base-commit: a58089ad2e41e88f81360f0e99bfd0715aceb556
change-id: 20251020-clk_funcs-c35369063c1f

Best regards,
-- 
Andrew Goodbody <andrew.goodbody at linaro.org>



More information about the U-Boot mailing list