From patchwork Thu Dec 22 17:18:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 35886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp71757wrn; Thu, 22 Dec 2022 09:22:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXsvtySnWlG11Jp28fun5Y0cWVVlrC3wfFSYMoRaPPYSYoZV6DXiGoUwmE90sxXB6URqUu9j X-Received: by 2002:a17:903:40ca:b0:192:4a7b:ee27 with SMTP id t10-20020a17090340ca00b001924a7bee27mr6576785pld.53.1671729777892; Thu, 22 Dec 2022 09:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671729777; cv=none; d=google.com; s=arc-20160816; b=SLd5q39Ezm7LVrwSyF1iDc2xH05llh3u+nc0StgP4WTsnwhcCLBZ/2uZWU+JxU54lG aymGwvVHMaYVs+fr3nt25JTNBPOhYUEvOixynJk+VOUqotDIm7gO2u8fRvVnev/WL3df nj7/ZXP702Wa96C+wM9TabnjPKQoUYVkultF+EzDcmmxFy8WYkBjhY7HgJTq11LXpZwg v/C9R+pyXZDK92ooqUKPWEtY5+7NwwY3wmXwbedkK+ysl3kHWQGPnLVcNIdsKp3kTd75 BdH0kPV/roiWqOmfiYbla3CSY8qSBZeKpkNKDoboaOroiZTmWFh0UnK1ADuo0GCXr4kc yXRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=Tujst/9jAYX8wMkCgjlfbXM55HjFRnDMLXNJ2vaPNus=; b=0WJ82K6NHtr7DGmVZD7AgetdiNNIqrNB2CudEbaEfaxgCNYjdADqUlDw3o57bkS3MW EqmjkOY9ehS2CrrukfvHi5buJVqxnm0ojv1UVMtztU1hLfnKuzHtEomb0pC5xf4J4Mgj RsqgWOxVKHbR/1UhDOnNSm3Z6nptF5rcYP6HFqYdExU2eConNAf4STgfqFy0gu/Tjfoy l8Y3HM9EDHOGX90YMIBei35lKEWjZRXIVOeOS+ajQnFhWCwM3sNa04LSmhmK4QOfT+aJ DuiqLDaIAyyeeJl2jaX4Ms6GoBmJREBwCHOh8/VQz5Xz1F/vdY7uhtpi2lhSMlstwXFT NIJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=fMq9hio7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a170902e84a00b00189754b9d97si1043434plg.122.2022.12.22.09.22.45; Thu, 22 Dec 2022 09:22:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=fMq9hio7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230156AbiLVRSz (ORCPT + 99 others); Thu, 22 Dec 2022 12:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbiLVRSw (ORCPT ); Thu, 22 Dec 2022 12:18:52 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD5C2B242 for ; Thu, 22 Dec 2022 09:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671729516; bh=StquY4wdmhgaNyls5O+dcyLQ6Cptvx72ASz210O3A6U=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=fMq9hio7BzUAmW233U4M7DFDbeCZx+XHLaRz56Vdc308KjkAAe5rdsvFpQM9WvaGb F6UDZ79Jmad8XKKzRCg9olUv1XfcOifGYAjUTzL+RtnBTUUXFa1v7MnQN+DNZWOFsZ twVfe3HZqwBsbEq2ks1gQX8e3hzrkex9gziB5YIo= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via ip-206.mailobj.net [213.182.55.206] Thu, 22 Dec 2022 18:18:35 +0100 (CET) X-EA-Auth: +UzcuDTVw7b103pzKMi29hCxA7XsqGR1ZcuFunxSFb3oUi5dkg3viG5PJ2HAqjZI/GowK4tLl/IklOTFfTex1FdD5aloAddj Date: Thu, 22 Dec 2022 22:48:29 +0530 From: Deepak R Varma To: Support Opensource , Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , drv@mailo.com Subject: [PATCH] power: supply: da9150: Remove redundant error logging Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752935723835996498?= X-GMAIL-MSGID: =?utf-8?q?1752935723835996498?= A call to platform_get_irq_byname() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces and the device pointer variable dev unnecessary. Remove those as well. Issue identified using platform_get_irq.cocci coccinelle semantic patch. Signed-off-by: Deepak R Varma --- Note: The change was build tested using ARM64 defconfig. drivers/power/supply/da9150-charger.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.34.1 diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c index f9314cc0cd75..14da5c595dd9 100644 --- a/drivers/power/supply/da9150-charger.c +++ b/drivers/power/supply/da9150-charger.c @@ -466,10 +466,8 @@ static int da9150_charger_register_irq(struct platform_device *pdev, int irq, ret; irq = platform_get_irq_byname(pdev, irq_name); - if (irq < 0) { - dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq); + if (irq < 0) return irq; - } ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT, irq_name, charger); @@ -482,15 +480,12 @@ static int da9150_charger_register_irq(struct platform_device *pdev, static void da9150_charger_unregister_irq(struct platform_device *pdev, const char *irq_name) { - struct device *dev = &pdev->dev; struct da9150_charger *charger = platform_get_drvdata(pdev); int irq; irq = platform_get_irq_byname(pdev, irq_name); - if (irq < 0) { - dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq); + if (irq < 0) return; - } free_irq(irq, charger); }