From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BFCCEEC875F for ; Fri, 8 Sep 2023 02:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5i+3SANKXgE5jn7wr1YnzT8sLryPY0vmSEXddsm8NTc=; b=2077yPv/7v0dlw yS2YJfF1SNEX7xC6zaGW068KczsWzBB+vHGSjZ3AiYkI9BiVwyOgKDZu3d38nBqQGRJ0mYdw6Gu+t OAJnlHkXbP+TaXy6CdiBXmUFQXx9twFpyns4zpcFSWdzBJcr0bR9onh+UGFnOPLThWwxCWEayH0Bp UMLTREXZqS7S7SK65z/RW0WwByemEPHzHNkCSsPj1VU6DfkKvlbwSK9eUPlBOrsmEzhlBPISnI243 3bZHMNedfc/Rj6Quc1xqfZRj3pt06Q/nf7aEcSaDZHuTYZzWDZWGFrN0N8yg9h+NEZSzqneTGNW09 A6Ug1nzMxb7VulArqk1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeR69-00CviC-0H; Fri, 08 Sep 2023 02:19:53 +0000 Received: from mg.richtek.com ([220.130.44.152]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qeR63-00Cvh4-2p; Fri, 08 Sep 2023 02:19:50 +0000 X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.47 by mg.richtek.com with MailGates ESMTPS Server V6.0(696440:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Fri, 08 Sep 2023 10:19:13 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex4.rt.l (192.168.10.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Fri, 8 Sep 2023 10:19:13 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Fri, 8 Sep 2023 10:19:13 +0800 Date: Fri, 8 Sep 2023 10:19:13 +0800 From: ChiaEn Wu To: Dan Carpenter CC: AngeloGioacchino Del Regno , Harshit Mogalapalli , Sebastian Reichel , Matthias Brugger , Andy Shevchenko , , , , , , Subject: Re: [PATCH] power: supply: mt6370: Fix missing error code in mt6370_chg_toggle_cfo() Message-ID: <20230908021913.GB3115@linuxcarl2.richtek.com> References: <20230906084815.2827930-1-harshit.m.mogalapalli@oracle.com> <1092ffb3-0238-4dc0-baf3-344a653fca3f@kadam.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1092ffb3-0238-4dc0-baf3-344a653fca3f@kadam.mountain> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230907_191948_355975_F760DFCE X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 07, 2023 at 02:08:17PM +0300, Dan Carpenter wrote: [...] > > > diff --git a/drivers/power/supply/mt6370-charger.c b/drivers/power/supply/mt6370-charger.c > > > index f27dae5043f5..a9641bd3d8cf 100644 > > > --- a/drivers/power/supply/mt6370-charger.c > > > +++ b/drivers/power/supply/mt6370-charger.c > > > @@ -324,7 +324,7 @@ static int mt6370_chg_toggle_cfo(struct mt6370_priv *priv) > > > if (fl_strobe) { > > > dev_err(priv->dev, "Flash led is still in strobe mode\n"); > > > - return ret; > > > + return -EINVAL; > > > > I think that returning 0 here was intentional, but I agree on a return ret > > here being both confusing and wrong. > > If it's a success path then probably we should remove the dev_err(). > Hi all, Sorry for the late reply! I agree with the first half of Angelo's statement, I did make the mistake on this 'return ret'. What I was trying to say is that you should not to toggle cfo function when the FLED of MT6370 is still in "strobe mode". Therefore, I think the change of Harshit's patch is correct. It should be 'return -EINVAL' or 'return -EPERM' here. Thanks! Reviewed-by: ChiaEn Wu Best regards, ChiaEn Wu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel