From patchwork Fri Aug 23 13:15:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2849388 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 751209F9CC for ; Mon, 26 Aug 2013 05:33:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 738CD201FF for ; Mon, 26 Aug 2013 05:33:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 84B0E201B8 for ; Mon, 26 Aug 2013 05:33:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60D50E6E16 for ; Sun, 25 Aug 2013 22:33:24 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 65652E65B8 for ; Fri, 23 Aug 2013 06:15:17 -0700 (PDT) Received: by mail-bk0-f47.google.com with SMTP id mx12so225118bkb.34 for ; Fri, 23 Aug 2013 06:15:16 -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=hr5nouHdBeggiP9l2o5APZS0a32MZIX7xsAEMqIKnew=; b=s531e+k4CsB/+XoEonXA5HYNHGcv7QaubsuXygprThn30FUf+9OfvCTJb3UxyZy0+k CTV0OUTR0G8nKhOfy7flR4ngaopUKUMouaGlzKhac5I7LUqTN++OFnMr2Pja6bIy4ChU dPK/GoNHw7BMbyRp/HH3xnrEPCYxDLHRiGnyLjnuN2kX6jOHvbLWZiZXrjYX504154XV R8MuUeEZBxuHwIe5bH4/jjUyTDOfiJ3h38ilzfFLx34vHiWI9yemhzB/+cAS6pjen476 SGbCd+tANz7LU8g3Pxeqlrbceb4QGIwma/HnoCQFbfSCKINBwAsAxCnvSeTNLCc83Rt+ IlHw== MIME-Version: 1.0 X-Received: by 10.205.24.131 with SMTP id re3mr15251630bkb.8.1377263716337; Fri, 23 Aug 2013 06:15:16 -0700 (PDT) Received: by 10.205.13.74 with HTTP; Fri, 23 Aug 2013 06:15:16 -0700 (PDT) Date: Fri, 23 Aug 2013 21:15:16 +0800 Message-ID: Subject: [PATCH -next v2] drm/rcar-du: remove redundant dev_err call in rcar_du_lvdsenc_get_resources() From: Wei Yongjun To: airlied@linux.ie, laurent.pinchart+renesas@ideasonboard.com X-Mailman-Approved-At: Sun, 25 Aug 2013 22:33:06 -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.5 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 and check for return value of platform_get_resource_byname(). Signed-off-by: Wei Yongjun --- v1 -> v2; remove return value check of platform_get_resource_byname() --- drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 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..fe1f6f5 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c @@ -144,18 +144,9 @@ static int rcar_du_lvdsenc_get_resources(struct rcar_du_lvdsenc *lvds, sprintf(name, "lvds.%u", lvds->index); mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); - if (mem == NULL) { - dev_err(&pdev->dev, "failed to get memory resource for %s\n", - name); - return -EINVAL; - } - 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)) {