mmc: fsl_esdhc_imx: Cannot test unsigned to be < 0

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>
This commit is contained in:
Andrew Goodbody
2025-10-21 17:08:26 +01:00
committed by Tom Rini
parent e24a7b3b17
commit 42d30f9447

View File

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