From 85316eae487fd7e1535860f3b1b2f9d3996d08db Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Mon, 21 Oct 2013 11:34:07 +0800 Subject: [PATCH] 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 --- drivers/gpu/drm/tegra/dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5