From patchwork Thu Aug 14 00:59:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 4731021 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A8579C0338 for ; Sun, 17 Aug 2014 11:38:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D69DA2012B for ; Sun, 17 Aug 2014 11:38:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA29C20120 for ; Sun, 17 Aug 2014 11:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B2AE6E2DE; Sun, 17 Aug 2014 04:38:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from m12-15.163.com (m12-15.163.com [220.181.12.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 295CE6E131 for ; Wed, 13 Aug 2014 17:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=dQqtq4hZYmZR1WDyof kJjP7BC45NZA35JRnXrjiYinI=; b=NG4N0VkagDF4EugobaWc7UKK3ecHrSvu5B L0n/et0P/KsvAyL4Pb0l2Yjgmpm6kaNJm4yNfCsljSZVM3xX7Ew94MND9u0Q0qnP Mz0t11zjSHs07qpr2ajRrJEEuqAFOkZpd8gsYH1NzGiqSMqWKTjnz5fTYDzmfjFA J8TEdN7uA= Received: from localhost.localdomain.localdomain (unknown [49.77.231.131]) by smtp11 (Coremail) with SMTP id D8CowEB5+GfoCexTpvl+AA--.1203S2; Thu, 14 Aug 2014 08:59:21 +0800 (CST) X-Coremail-DSSMTP: 49.77.231.131 From: weiyj_lk@163.com To: David Airlie , Grant Likely , Rob Herring , Benjamin Gaignard , Rob Clark Subject: [PATCH] drm: sti: tvout: fix return value check in sti_tvout_probe() Date: Thu, 14 Aug 2014 08:59:19 +0800 Message-Id: <1407977959-15364-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: D8CowEB5+GfoCexTpvl+AA--.1203S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUXryrJryktF1UGFy3Arb_yoWDJFb_CF WDZrn3Wrs0kF1qvF47Ar13AF9avF4DurZ7Xa15ta43trWUJr15J3s3uryUur1UWanrXFWq yas2vr1fZFn3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5WxRPUUUUU== X-Originating-IP: [49.77.231.131] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbibgrn1lD+J1qXxgAAsX X-Mailman-Approved-At: Sun, 17 Aug 2014 04:38:33 -0700 Cc: Wei Yongjun , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap_nocache() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/sti/sti_tvout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index b69e26f..9ad2d44 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -591,8 +591,8 @@ static int sti_tvout_probe(struct platform_device *pdev) return -ENOMEM; } tvout->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (IS_ERR(tvout->regs)) - return PTR_ERR(tvout->regs); + if (!tvout->regs) + return -ENOMEM; /* get reset resources */ tvout->reset = devm_reset_control_get(dev, "tvout");