From patchwork Thu Jan 9 07:27:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 11325121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB6BD1398 for ; Thu, 9 Jan 2020 07:25:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B88252053B for ; Thu, 9 Jan 2020 07:25:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YJBjg+97"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=embeddedor.com header.i=@embeddedor.com header.b="vsIYH0hO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B88252053B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ATitaKuCF7Xev4Hwj6VlxVSLQIEx7IEETiO9/2bH2CQ=; b=YJBjg+97afnKxz XVaMwEXl2BJWSxg6w73rBXa2IoFbWcUh+QtHJA4xB+voGyh1J9i30m5H+uyHJOD4ZErkqqQE+9UUQ dF97MRc8qagaYYUxCdUXEQtoVfd11wNwxov010lVbVLbzF6hzcfFNNMSEVJzsITBWjsrihu9YI0HQ R/Bo1FlawvPb6ZeOJVIGUmaEirLieFya5YPEr3qvDErj7g0Inbn81dfV1ZIJ0qH1Eg0nDHiDsTZpT JT8GRItMRPUljZizs+ef1NvWamFS+oC8ZOOchJT9aGiUbMxE8sGtxRW/O1bAOW5WGN9eGfdvv0/zX klktDEH1EEQKuTCR/gcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipSCW-0004Ri-R8; Thu, 09 Jan 2020 07:25:52 +0000 Received: from gateway31.websitewelcome.com ([192.185.144.218]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipSCT-0004QG-R2 for linux-arm-kernel@lists.infradead.org; Thu, 09 Jan 2020 07:25:51 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id E19302079CD for ; Thu, 9 Jan 2020 01:25:37 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id pSCHiirPbHiO0pSCHihsKo; Thu, 09 Jan 2020 01:25:37 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Type:MIME-Version:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZGG68xB9srENApCLFB8NBnGMr0wtGwoST9dYSScyw8w=; b=vsIYH0hOFBwj3BrTLB197B7YcA odvWXuI6yOFwAjN1MJe0rVsNO2bhblFxE3WStAwNRx8A64wf9TJ9nOybBO5gAVrVRsbxBne6Xlj5Z Uy1l+oJV/RVZ2VRWFsTfZ7RoQmnGq8jUydHva4wPLcQqm1qs96Xx+oZd/aRmT6affDu9TwIWCmaer TLbAP/hzYKR3xnnF7iJTNQXduRZtVRLb0ynGN0gQ36zqc4v1D9T6PhpnmExJL5FJ9V3CfvanfpBY/ 1WjphPt9wY4aJb8Jr/VGBh7cIQRuZ+7g9YY0aERYlU5ufwEe1IIfCfTnQaK0If1y9dv5vFOAhDD5f K1QCN5Xw==; Received: from [189.152.215.240] (port=37182 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.92) (envelope-from ) id 1ipSCF-000871-Le; Thu, 09 Jan 2020 01:25:36 -0600 Date: Thu, 9 Jan 2020 01:27:35 -0600 From: "Gustavo A. R. Silva" To: Thierry Reding , Uwe =?iso-8859-1?q?Kleine-K?= =?iso-8859-1?q?=F6nig?= , Maxime Ripard , Chen-Yu Tsai , =?iso-8859-1?q?Cl=E9ment_P=E9ron?= , Jernej Skrabec Subject: [PATCH] pwm: sun4i: Fix inconsistent IS_ERR and PTR_ERR Message-ID: <20200109072735.GA22886@embeddedor> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.215.240 X-Source-L: No X-Exim-ID: 1ipSCF-000871-Le X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.152.215.240]:37182 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 8 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200108_232550_005667_1C1C09C3 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [192.185.144.218 listed in list.dnswl.org] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Gustavo A. R. Silva" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Fix inconsistent IS_ERR and PTR_ERR in sun4i_pwm_probe(). The proper pointers to be passed as arguments are pwm->clk and pwm->bus_clk. This bug was detected with the help of Coccinelle. Fixes: b8d74644f34a ("pwm: sun4i: Prefer "mod" clock to unnamed") Fixes: 5b090b430d75 ("pwm: sun4i: Add an optional probe for bus clock") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Uwe Kleine-König Reviewed-by: Uwe Kleine-König --- drivers/pwm/pwm-sun4i.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c index 1afd41ebd3fd..a805c347ee84 100644 --- a/drivers/pwm/pwm-sun4i.c +++ b/drivers/pwm/pwm-sun4i.c @@ -423,7 +423,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev) */ pwm->clk = devm_clk_get_optional(&pdev->dev, "mod"); if (IS_ERR(pwm->clk)) { - if (PTR_ERR(pwm->rst) != -EPROBE_DEFER) + if (PTR_ERR(pwm->clk) != -EPROBE_DEFER) dev_err(&pdev->dev, "get mod clock failed %pe\n", pwm->clk); return PTR_ERR(pwm->clk); @@ -432,7 +432,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev) if (!pwm->clk) { pwm->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pwm->clk)) { - if (PTR_ERR(pwm->rst) != -EPROBE_DEFER) + if (PTR_ERR(pwm->clk) != -EPROBE_DEFER) dev_err(&pdev->dev, "get unnamed clock failed %pe\n", pwm->clk); return PTR_ERR(pwm->clk); @@ -441,7 +441,7 @@ static int sun4i_pwm_probe(struct platform_device *pdev) pwm->bus_clk = devm_clk_get_optional(&pdev->dev, "bus"); if (IS_ERR(pwm->bus_clk)) { - if (PTR_ERR(pwm->rst) != -EPROBE_DEFER) + if (PTR_ERR(pwm->bus_clk) != -EPROBE_DEFER) dev_err(&pdev->dev, "get bus clock failed %pe\n", pwm->bus_clk); return PTR_ERR(pwm->bus_clk);