From patchwork Tue Apr 25 03:08:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9697471 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F09560224 for ; Tue, 25 Apr 2017 03:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ABC622376 for ; Tue, 25 Apr 2017 03:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EC6A2815E; Tue, 25 Apr 2017 03:08:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABB8F228C9 for ; Tue, 25 Apr 2017 03:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S980136AbdDYDIP (ORCPT ); Mon, 24 Apr 2017 23:08:15 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34318 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S979940AbdDYDIP (ORCPT ); Mon, 24 Apr 2017 23:08:15 -0400 Received: by mail-pf0-f193.google.com with SMTP id g23so7386756pfj.1 for ; Mon, 24 Apr 2017 20:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aMuBX8EP95Flq+bCx5SKjDMQYbqOSkF+wl2ejIqsoME=; b=EGXQbc1+avR1X9tnAj9Y5+9xa8FcWyCYQnEMVcBBGs/4oB6ffDfkbh489axTDNoFFX xrrqwJl/fczyl0LPtUQ1PIyvXtk6aHu/6/+seaK9IYk93AjP49sg/qYrpcQMeb09EBEv JUWcnI+5Wam5yiAYpWNKSS3rVsXYKdBpHzIb6Oovgj2VNu3Lxdi4PgmHXvfBWYky2MPy ouoMFgPkKIJ6g8B1y7/nh0zYGEhDhN82+RCh6s6QJ2Yi4YjYswg5Sakffe91ymsxsM5X UEZNCjQaIYlkcWeodlBacahyza9PHb6znEunHVKrvC4+ovKG2cSZXEpRurge3ZJ4zaiY tw8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aMuBX8EP95Flq+bCx5SKjDMQYbqOSkF+wl2ejIqsoME=; b=Rb/bcmlILISFrEYxae+tnAPHCi45DIcefDXd3bJ27UAdI9ZJ8IPOl4gxuY5AW4paTq iOExKjIuuqexoEDwAXIj4MD57czMhpnTOTZn6a0jFozj0iLcjQq/gyUhM1hl7i0pYWgu nDcnZxOrLKXES2x4QaSJRJon1o0in43CKnccgTdt1m/eTlnZmDGYXkncmNF+ExuHQpgU nIiFT4qUZ4Sj2PPXCPIlGlDlqNzWgulfNGekv2ZvJ61zZ134LahXzKYOgwtcEQ0kOAf0 Qe7nFiJByGw6Td+l3rWvhn5cmRLGDsm6JGOXQyojQY1HPmMNTwhRxQ/TqcGQYDXiRjLQ dWSg== X-Gm-Message-State: AN3rC/4i7DLN+6d5xlj1AsorBiAg/4zreX2s8D9BpPBOR6rA+RfwNrbL gZU/CoPo1KLGZA== X-Received: by 10.99.254.69 with SMTP id x5mr26958827pgj.2.1493089694473; Mon, 24 Apr 2017 20:08:14 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id m29sm33054199pfj.32.2017.04.24.20.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Apr 2017 20:08:13 -0700 (PDT) From: Wei Yongjun To: Laurent Pinchart , David Airlie Cc: Wei Yongjun , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH -next] drm/shmob: fix return value check in shmob_drm_probe() Date: Tue, 25 Apr 2017 03:08:08 +0000 Message-Id: <20170425030808.7632-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.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(). Signed-off-by: Wei Yongjun Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index 800d1d2..6bd777a 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -235,8 +235,8 @@ static int shmob_drm_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); sdev->mmio = devm_ioremap_resource(&pdev->dev, res); - if (sdev->mmio == NULL) - return -ENOMEM; + if (IS_ERR(sdev->mmio)) + return PTR_ERR(sdev->mmio); ret = shmob_drm_setup_clocks(sdev, pdata->clk_source); if (ret < 0)