From patchwork Fri Aug 23 02:21:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2848535 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 630709F2F4 for ; Fri, 23 Aug 2013 05:36:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D644201F9 for ; Fri, 23 Aug 2013 05:36:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 396A9201F5 for ; Fri, 23 Aug 2013 05:36:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 148E8E5FDA for ; Thu, 22 Aug 2013 22:36:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f42.google.com (mail-bk0-f42.google.com [209.85.214.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 25879E5D3E for ; Thu, 22 Aug 2013 19:21:22 -0700 (PDT) Received: by mail-bk0-f42.google.com with SMTP id my10so23758bkb.1 for ; Thu, 22 Aug 2013 19:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=9h/NhsYj4OHA6KsflLsTME3yMyU2jTrDqCxs4MW+p7g=; b=hA1hHgxJRo6feAvvHOAgVXWXTgzUtoVTpEmXhRw0OKBZBlMMho/MsmQvQjxAoF0Xzs /CyBCIcrOOR2TYoDzptpZR+9ImO5MuIqTH4KCb5N6cQ3APbL+dNur6XQwV0wL8lAe8JO Ca0bEKbIclUOPKSMzVk4hE9d53Ax2Mx0gWWHlptT6Zsc0aOaasMPxfxzwY3T2ROyc1H4 wfNwFCLe2RgvdV0c50wNc4ADuWoaAjzZsn47YsaLjUr251Upy2LswofpHe0HnTe/+MXv EIjtKH20p11H4pwrkBrkpqGfJ6iwZSz7cZPeiQ3TlTfnYQEEtxUcivZ03v3wYIWST61/ Ms6w== MIME-Version: 1.0 X-Received: by 10.205.15.72 with SMTP id pt8mr12618842bkb.17.1377224481366; Thu, 22 Aug 2013 19:21:21 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Thu, 22 Aug 2013 19:21:21 -0700 (PDT) Date: Fri, 23 Aug 2013 10:21:21 +0800 Message-ID: Subject: [PATCH -next] drm/rcar-du: fix return value check in rcar_du_lvdsenc_get_resources() From: Wei Yongjun To: airlied@linux.ie, laurent.pinchart+renesas@ideasonboard.com X-Mailman-Approved-At: Thu, 22 Aug 2013 22:36:14 -0700 Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Also remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c index a0f6a17..f59cbc4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c @@ -151,11 +151,8 @@ static int rcar_du_lvdsenc_get_resources(struct rcar_du_lvdsenc *lvds, } lvds->mmio = devm_ioremap_resource(&pdev->dev, mem); - if (lvds->mmio == NULL) { - dev_err(&pdev->dev, "failed to remap memory resource for %s\n", - name); - return -ENOMEM; - } + if (IS_ERR(lvds->mmio)) + return PTR_ERR(lvds->mmio); lvds->clock = devm_clk_get(&pdev->dev, name); if (IS_ERR(lvds->clock)) {