From patchwork Sat Jul 30 06:32:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9253293 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 5C3116048F for ; Sun, 31 Jul 2016 07:47:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F7F828460 for ; Sun, 31 Jul 2016 07:47:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 442D228482; Sun, 31 Jul 2016 07:47:22 +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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAC7928460 for ; Sun, 31 Jul 2016 07:47:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43CA56E0F1; Sun, 31 Jul 2016 07:47:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6DD636E1DA for ; Sat, 30 Jul 2016 06:32:26 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id g202so6623809pfb.1 for ; Fri, 29 Jul 2016 23:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tQ+L55qwtOi46gf4MvqG/XenLurb2UMcYXgXTVTXYsg=; b=hcK/fpekaZzRUIG2uRPhgLZ2j1w9n3fJOQsZyftE6bhjAaFrQ8BZL7tMcOKg8ygRFs ZZ9vm56IcgVYlDB+Rhj2JRClX3DXDSwfUdG/LZliBEAC7sPYpQBTkp/ni2DWz6ko8QQ3 8pCVCBs6JqWyIw86GVcBMC6J5WaC9zufWj+41m06TW4H36xApGIin3r8jI0AS3UZXLwk wYbo6swfkwu8yXlIgbLNQKTwqTEoB/ikdIF0kniAKNdkLlwpxH3PAKyKVhR572bmAjb4 MRAmXPYyq7wlUrr9w3BHRpNJuYm3fecjRSJkUtd9VAN1DK/pWWnLD7TzeSrE7bNgeLBf Pf6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tQ+L55qwtOi46gf4MvqG/XenLurb2UMcYXgXTVTXYsg=; b=F3m4W3QaU+kKMqOBXmnrI8A6A2XwQHUNVtOI0wmavGtvMRYKyJAsrYZWSB2A5dg0wq kY+J8XcgX9Zuekk2F1b1dksIB8157CLQZNC4dKQnUV+lMIWICJT0I14vne8ncM9vi/G5 i7x/UkH1PT8qZocDqq9o9vVdtM/AsdT44Qq4Vt1QZggyuDJDyKDPqtXaQoOxqtEE48fK J9C1tkJqWq98aosm1GSKcjLmARZiXpb5cwGyn64ZMSwVhC2MrYWKam4gPxmeDy6+uZOE KsoLF7oCMQEsSCeSx7VqiaC3U4ru8J2ZEPaHVa6bRzlZiTnEBN5gH1GrEV0pvpqrBtqg Sllg== X-Gm-Message-State: AEkoouvhBV2pkpmfYB+DCDLJ0TNFVQ0pxUgZR2kjCOITEcKIm1KKPpSJSIBZ2jIMGijZCA== X-Received: by 10.98.8.13 with SMTP id c13mr75380772pfd.166.1469860344678; Fri, 29 Jul 2016 23:32:24 -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 fe8sm23915059pad.2.2016.07.29.23.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jul 2016 23:32:23 -0700 (PDT) From: Wei Yongjun To: Thierry Reding , David Airlie , Stephen Warren , Alexandre Courbot Subject: [PATCH -next] drm/tegra: dpaux: Fix return value check in tegra_dpaux_probe() Date: Sat, 30 Jul 2016 06:32:17 +0000 Message-Id: <1469860337-2686-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 31 Jul 2016 07:47:07 +0000 Cc: linux-tegra@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 In case of error, the function devm_pinctrl_register() 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 --- drivers/gpu/drm/tegra/dpaux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/dpaux.c b/drivers/gpu/drm/tegra/dpaux.c index 059f409..2fde44c 100644 --- a/drivers/gpu/drm/tegra/dpaux.c +++ b/drivers/gpu/drm/tegra/dpaux.c @@ -539,9 +539,9 @@ static int tegra_dpaux_probe(struct platform_device *pdev) dpaux->desc.owner = THIS_MODULE; dpaux->pinctrl = devm_pinctrl_register(&pdev->dev, &dpaux->desc, dpaux); - if (!dpaux->pinctrl) { + if (IS_ERR(dpaux->pinctrl)) { dev_err(&pdev->dev, "failed to register pincontrol\n"); - return -ENODEV; + return PTR_ERR(dpaux->pinctrl); } #endif /* enable and clear all interrupts */