]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: rk3288_mipi: check in rk_mipi_ofdata_to_platdata
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 18 Mar 2018 14:25:41 +0000 (15:25 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 28 Mar 2018 21:44:58 +0000 (23:44 +0200)
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 <xypron.glpk@gmx.de>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/video/rockchip/rk3288_mipi.c

index 953b47fb8c8e5cc2b11e7f83922ca8e04a7ea870..27d125f77e3b8660d759988731d20bb23e17fc65 100644 (file)
@@ -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;