From: Haolin Li Date: Tue, 22 Mar 2022 12:58:02 +0000 (-0700) Subject: mmc: rockchip_sdhci: Correct error checking X-Git-Tag: v2025.01-rc5-pxa1908~1451^2~47 X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=fdda7901cc77b5bc525263c385cc19f151b6612b;p=u-boot.git mmc: rockchip_sdhci: Correct error checking A pointer can not be negative. Use macro IS_ERR_OR_NULL() for checking. Signed-off-by: Haolin Li Reviewed-by: Simon Glass Reviewed-by: Kever Yang Reviewed-by: Jaehoon Chung --- diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index 1fdc841517..9608770d4e 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -227,7 +227,7 @@ static int rk3399_emmc_get_phy(struct udevice *dev) } grf_base = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); - if (grf_base < 0) { + if (IS_ERR_OR_NULL(grf_base)) { printf("%s Get syscon grf failed", __func__); return -ENODEV; }