]> git.sur5r.net Git - u-boot/commitdiff
video: rk3399_mipi: correct error checking
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 18 Mar 2018 14:18:10 +0000 (15:18 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Wed, 28 Mar 2018 21:30:31 +0000 (23:30 +0200)
Pointers are never negative. Use macro IS_ERR() for checking.
cf. rk3288_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/rk3399_mipi.c

index 9ef202bf090e2d827732ba519c993494c66e8623..c6987ff042e70ad00ec9e7158cb13066fca81ff3 100644 (file)
@@ -128,7 +128,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 (priv->grf <= 0) {
+       if (!priv->grf || IS_ERR(priv->grf)) {
                debug("%s: Get syscon grf failed (ret=%p)\n",
                      __func__, priv->grf);
                return  -ENXIO;