From: Heinrich Schuchardt Date: Sun, 18 Mar 2018 14:25:41 +0000 (+0100) Subject: video: rk3288_mipi: check in rk_mipi_ofdata_to_platdata X-Git-Tag: v2018.05-rc1~5^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ea91c3240bdb32b901a3c0639d35ab559b675db;p=u-boot video: rk3288_mipi: check in rk_mipi_ofdata_to_platdata The error checking should also catch the case that no range has beeen defined. syscon_get_first_range() returns NULL if no range is defined. cf. rk3399_mipi.c Signed-off-by: Heinrich Schuchardt Acked-by: Philipp Tomsich Reviewed-by: Philipp Tomsich --- diff --git a/drivers/video/rockchip/rk3288_mipi.c b/drivers/video/rockchip/rk3288_mipi.c index 953b47fb8c..27d125f77e 100644 --- a/drivers/video/rockchip/rk3288_mipi.c +++ b/drivers/video/rockchip/rk3288_mipi.c @@ -136,7 +136,7 @@ static int rk_mipi_ofdata_to_platdata(struct udevice *dev) struct rk_mipi_priv *priv = dev_get_priv(dev); priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); - if (IS_ERR(priv->grf)) { + if (!priv->grf || IS_ERR(priv->grf)) { debug("%s: Get syscon grf failed (ret=%p)\n", __func__, priv->grf); return -ENXIO;