From patchwork Thu Apr 16 12:19:24 2015 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: 6228191 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 822559F1AC for ; Fri, 17 Apr 2015 01:49:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 868E120389 for ; Fri, 17 Apr 2015 01:49:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F2FB62038E for ; Fri, 17 Apr 2015 01:49:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D621D6E1FB; Thu, 16 Apr 2015 18:48:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1006 seconds by postgrey-1.34 at gabe; Thu, 16 Apr 2015 05:43:13 PDT Received: from m12-15.163.com (m12-15.163.com [220.181.12.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 962EF6EA35 for ; Thu, 16 Apr 2015 05:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=cRvLW9vjvI9G192len rllddl57lHggd9acqcUM3TS0U=; b=pyRr/i8kdZ+0zGLtP1v+BBlzQerMMXaNRY MA8qw/003LGx5aydTQiyOWc2/mnTwpVtkrI62jqUkDs/7evJucDrupiDhXlsCJIT 3iMp7MVHZKbc86LtMOQuhOy/14eydN5vpJysRhU6NO1DOApzsho9YsQjdUrUBYco zEGpu6TMI= Received: from localhost.localdomain.localdomain (unknown [49.77.26.90]) by smtp11 (Coremail) with SMTP id D8CowEAJdUvNqC9Vpmh4Ag--.98S2; Thu, 16 Apr 2015 20:19:31 +0800 (CST) X-Coremail-DSSMTP: 49.77.26.90 From: weiyj_lk@163.com To: David Airlie , Dave Airlie , Thierry Reding , Benjamin Gaignard Subject: [PATCH] drm/sti: fix return value check in sti_dvo_probe() Date: Thu, 16 Apr 2015 20:19:24 +0800 Message-Id: <1429186764-20812-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: D8CowEAJdUvNqC9Vpmh4Ag--.98S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUXryrJrykKrWxurWDtwb_yoWfCwc_C3 yrZrn3XFZrWF1qqF42kw4avF9ayF4DuFWkXr1Fya4fJrW7tr17XayxWryUuF1DXws8KFZr t392vr1akr9xGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnXdjtUUUUU== X-Originating-IP: [49.77.26.90] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbioxTd1lULzUPGNwAAsd X-Mailman-Approved-At: Thu, 16 Apr 2015 18:48:58 -0700 Cc: Wei Yongjun , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID,T_RP_MATCHES_RCVD, 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 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_dvo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index aeb5070..ae4c3df 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -495,8 +495,8 @@ static int sti_dvo_probe(struct platform_device *pdev) } dvo->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); - if (IS_ERR(dvo->regs)) - return PTR_ERR(dvo->regs); + if (!dvo->regs) + return -ENOMEM; dvo->clk_pix = devm_clk_get(dev, "dvo_pix"); if (IS_ERR(dvo->clk_pix)) {