From: Wei Yongjun Date: Mon, 21 Oct 2013 03:34:07 +0000 (+0800) Subject: drm/tegra: Fix return value check X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=85316eae487fd7e1535860f3b1b2f9d3996d08db;p=openwrt%2Fstaging%2Fblogic.git drm/tegra: Fix return value check 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 Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 84a73e32214f..844818f3e2d5 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -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);