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: 9697515 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 D6CBD6020A for ; Tue, 25 Apr 2017 03:59:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB73A28447 for ; Tue, 25 Apr 2017 03:59:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF2BA28456; Tue, 25 Apr 2017 03:59:26 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56FFD28447 for ; Tue, 25 Apr 2017 03:59:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0194E6E2CB; Tue, 25 Apr 2017 03:59:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id C71246E0CF for ; Tue, 25 Apr 2017 03:08:14 +0000 (UTC) Received: by mail-pf0-x244.google.com with SMTP id a188so7392709pfa.2 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=WpX/CTnJrYpNhoEkEgaDf1G5d+ijyYlnYa8x+mnyibgx5+qzCkUv8p7KWB/x25L1U1 cHbzbtVgY+9uVT7yMDAQzKfhu30gGqywFqcP/O5jWSXAzSValDrVvpgmhLFkPDBipAHD eZ36dzaP96vCCX/02BhNQ+3D5L64CLEaYYcTxyjgJ0ESwnr8H7Khx716XfmYAZzC4b8+ 73XHVR03IEpxp1VHfCbQtz5tfmWNwSuu0hO3hdGt8p8JKW7/Nachawe9sU0R0EmXbR7f SNezRHkLWSXr9aoB2oiV53pLuT0t3jMHPANLkwqfUqsidcyszO2CYtAh6e+WPj9L+rCk m9wg== X-Gm-Message-State: AN3rC/7pR0pIG2MQDrMvhZEaYWH6xmZiQTekvPnGXn2nRQip6JLV+3uI j4AHN6zUDqcvNj+AgMA= 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 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 X-Mailman-Approved-At: Tue, 25 Apr 2017 03:59:20 +0000 Cc: linux-renesas-soc@vger.kernel.org, Wei Yongjun , 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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)