From patchwork Sun May 21 01:01:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9739095 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 69AF160326 for ; Sun, 21 May 2017 14:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CD55286B7 for ; Sun, 21 May 2017 14:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5175E286D7; Sun, 21 May 2017 14:43:44 +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 104EF286B7 for ; Sun, 21 May 2017 14:43:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9028E6E1A2; Sun, 21 May 2017 14:43:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6B0389A6D for ; Sun, 21 May 2017 01:02:00 +0000 (UTC) Received: by mail-pg0-x241.google.com with SMTP id s62so13659236pgc.0 for ; Sat, 20 May 2017 18:02:00 -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=daPFIorl9xXDAe0uM8zaGv7qPKy2HVpugOWyJSWju2k=; b=AVAIbdfDZt9fmaIt3oHX7tNqIGcmKRU9BTqrHEJj/4EJ4EuWOQqNmStqVlPQelax1B EHZCnJTqHRO/JKXdqNnjrfDqxA4do/7qdvZuVk2TxV6OWjsoCsbU7Kc8Poiti0vQXB4n YQzICooIYQkP/9GH+v5XdnNP4SNRaOKT+GVCFvx0ZoEJgnHCOLg1cFXELbhCE8gZAsDK ChWzynlovgi5aOwxgC8q29W74H4pkPq3s7inp244vgM5nWrtSjV9OLVFDocopZAhVViu 8dsZIn/XcP7t0iIaXFdy81byqJun7ezEJNip7myQ0J5yRojKxOOEk1H1o8R6lxAVluS2 PGMg== 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=daPFIorl9xXDAe0uM8zaGv7qPKy2HVpugOWyJSWju2k=; b=PqIYeqwyoxNeAVi1DsiPAQbB08HY344rKraZFHGU1ca1/Wa8JC4U7wrBun1aSv7wov Ekz+pfMjNnaOc6uYKhyGY9/tETU5+sgiHW0MK4J0RxO777b0qJUw3j/TZ5QBrAAaar9o b2ANP20qtOHb2F1E0Z1b7Pz03/didadOeFHGlcE8gWXXzoNbU7TY1IkEulfpmqy+NooB R7+Bbf0YK10+j+F1ylDnLVDpKogmY0Inq2D3dp8b/DkHGSz9nduXoXLotwTJcaLef7AK SWLjSaSqGgImrchTALrCh3edn7ftyB2CghurbjJzhQ4e8OssKu2tJqFyvEqblc35Mc9t UOHA== X-Gm-Message-State: AODbwcAJ7VO8YZkDuvU6oTAYmdwmmOY3srNxYrqyAWlv3nh/aYKHAdyz /J0BKtRzVPM3tQ== X-Received: by 10.98.157.83 with SMTP id i80mr17941490pfd.166.1495328520415; Sat, 20 May 2017 18:02:00 -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 c196sm22850180pga.23.2017.05.20.18.01.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 May 2017 18:01:59 -0700 (PDT) From: Wei Yongjun To: Eric Anholt , David Airlie , Tom Cooksey Subject: [PATCH -next] drm/pl111: Fix return value check in pl111_amba_probe() Date: Sun, 21 May 2017 01:01:52 +0000 Message-Id: <20170521010152.6186-1-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 21 May 2017 14:43:01 +0000 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: , 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(). Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: Wei Yongjun --- drivers/gpu/drm/pl111/pl111_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 936403f..c6b93ff 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -203,9 +203,9 @@ static int pl111_amba_probe(struct amba_device *amba_dev, } priv->regs = devm_ioremap_resource(dev, &amba_dev->res); - if (!priv->regs) { + if (IS_ERR(priv->regs)) { dev_err(dev, "%s failed mmio\n", __func__); - return -EINVAL; + return PTR_ERR(priv->regs); } /* turn off interrupts before requesting the irq */