From patchwork Thu Aug 14 00:59:51 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: 4731091 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 D270EC033A for ; Sun, 17 Aug 2014 11:38:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B76F20122 for ; Sun, 17 Aug 2014 11:38:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3FBEB2012E for ; Sun, 17 Aug 2014 11:38:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09C7B6E3B7; Sun, 17 Aug 2014 04:38:40 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 912 seconds by postgrey-1.34 at gabe; Wed, 13 Aug 2014 18:15:16 PDT Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by gabe.freedesktop.org (Postfix) with ESMTP id B4A046E614 for ; Wed, 13 Aug 2014 18:15:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=xNRy21OZe7tKsjmI8n AA7Ni/8eK5DQmwXAxt+LysLZY=; b=kj4dbFM3OrkF5SVuv9/Q2RmfANsi5WXymb FeJT0pcFLIS9c0LCetbsVt99cOBJH6Ns+fS6LCTRE7AbD5yfwBu2iKSJaOoL30JW jDHB4zFWTFnxe2l3ryJGu1hj7r7F3ct0C95Cj0oLOGlNZM1idsgEWAUnGtx/AoPL JwHiERrJM= Received: from localhost.localdomain.localdomain (unknown [49.77.231.131]) by smtp9 (Coremail) with SMTP id DcCowEA5_1AICuxT4K2FAA--.792S2; Thu, 14 Aug 2014 08:59:53 +0800 (CST) X-Coremail-DSSMTP: 49.77.231.131 From: weiyj_lk@163.com To: David Airlie , Grant Likely , Rob Herring , Rob Clark , Benjamin Gaignard Subject: [PATCH] drm: sti: hda: fix return value check in sti_hda_probe() Date: Thu, 14 Aug 2014 08:59:51 +0800 Message-Id: <1407977991-15518-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 1.9.3 X-CM-TRANSID: DcCowEA5_1AICuxT4K2FAA--.792S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF17JrWUKr47Xr1xAr1kXwb_yoW8Jw4fpF 4fJFWjvryrtanrtw1xA3W8uFna9a4IqayFgry8GwsxC34rG3yUWrn8CFyUJFW7Jr92qw13 tFWDu3yUZFy5XF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07brL0OUUUUU= X-Originating-IP: [49.77.231.131] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbibgrn1lD+J1qg1QAAsz 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_hda.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 72d957f..2802b81 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -730,16 +730,16 @@ static int sti_hda_probe(struct platform_device *pdev) return -ENOMEM; } hda->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (IS_ERR(hda->regs)) - return PTR_ERR(hda->regs); + if (!hda->regs) + return -ENOMEM; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "video-dacs-ctrl"); if (res) { hda->video_dacs_ctrl = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (IS_ERR(hda->video_dacs_ctrl)) - return PTR_ERR(hda->video_dacs_ctrl); + if (!hda->video_dacs_ctrl) + return -ENOMEM; } else { /* If no existing video-dacs-ctrl resource continue the probe */ DRM_DEBUG_DRIVER("No video-dacs-ctrl resource\n");