[PATCH 2/6] mmc: fsl_esdhc_imx: Cannot test unsigned to be < 0
Andrew Goodbody
andrew.goodbody at linaro.org
Tue Oct 21 18:08:26 CEST 2025
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 at linaro.org>
---
drivers/mmc/fsl_esdhc_imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index 926113f79d363a3e69bcb3ca46fb8fb3c2178e91..7dc76563b7e43f692d709a299e006ed0e2d6f3b7 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -1543,7 +1543,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
init_clk_usdhc(dev_seq(dev));
priv->sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK + dev_seq(dev));
- if (priv->sdhc_clk <= 0) {
+ if (!priv->sdhc_clk || IS_ERR_VALUE(priv->sdhc_clk)) {
dev_err(dev, "Unable to get clk for %s\n", dev->name);
return -EINVAL;
}
--
2.47.3
More information about the U-Boot
mailing list