]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/sti: correctly test devm_ioremap() return
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 8 Jun 2015 13:25:52 +0000 (15:25 +0200)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Mon, 8 Jun 2015 13:28:10 +0000 (15:28 +0200)
In case of error, the function devm_ioremap_nocache() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check should
be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
drivers/gpu/drm/sti/sti_dvo.c

index a9b678af85a6f315716fa82871674519e017b9f3..d141d645bd13acd47c99b9c6b1de839e442fc280 100644 (file)
@@ -499,8 +499,8 @@ static int sti_dvo_probe(struct platform_device *pdev)
        }
        dvo->regs = devm_ioremap_nocache(dev, res->start,
                        resource_size(res));
-       if (IS_ERR(dvo->regs))
-               return PTR_ERR(dvo->regs);
+       if (!dvo->regs)
+               return -ENOMEM;
 
        dvo->clk_pix = devm_clk_get(dev, "dvo_pix");
        if (IS_ERR(dvo->clk_pix)) {