aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHaolin Li2022-03-22 05:58:02 -0700
committerKever Yang2022-04-18 11:25:12 +0800
commitfdda7901cc77b5bc525263c385cc19f151b6612b (patch)
tree748c2fa73a7b3e7aef2dcb3a71cfaa65480b240a /drivers
parent9859465bfe838bc8264d45e1a1bed847bba74bad (diff)
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 <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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/rockchip_sdhci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c
index 1fdc8415178..9608770d4ec 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;
}