drm/tegra: Fix return value check
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 21 Oct 2013 03:34:07 +0000 (11:34 +0800)
committerThierry Reding <treding@nvidia.com>
Fri, 20 Dec 2013 14:56:05 +0000 (15:56 +0100)
In case of error, the devm_ioremap_resource() function returns ERR_PTR()
and never NULL. The NULL test in the return value check should therefore
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dsi.c

index 84a73e32214fabc797784c8d876665e74528ae78..844818f3e2d5452f2c4f8c92622b357365222b3f 100644 (file)
@@ -886,8 +886,8 @@ static int tegra_dsi_probe(struct platform_device *pdev)
 
        regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        dsi->regs = devm_ioremap_resource(&pdev->dev, regs);
-       if (!dsi->regs)
-               return -EADDRNOTAVAIL;
+       if (IS_ERR(dsi->regs))
+               return PTR_ERR(dsi->regs);
 
        tegra_dsi_initialize(dsi);