]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: rockchip_sdhci: Correct error checking
authorHaolin Li <li.haolin@qq.com>
Tue, 22 Mar 2022 12:58:02 +0000 (05:58 -0700)
committerKever Yang <kever.yang@rock-chips.com>
Mon, 18 Apr 2022 03:25:12 +0000 (11:25 +0800)
A pointer can not be negative. Use macro IS_ERR_OR_NULL() for checking.

Signed-off-by: Haolin Li <li.haolin@qq.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/rockchip_sdhci.c

index 1fdc8415178b8e556d7020e6fa3c80c167d117d8..9608770d4eccd726b04d80946a9cb9cc0be4ed95 100644 (file)
@@ -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;
        }