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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9DB4EB8FB1 for ; Fri, 8 Sep 2023 02:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240333AbjIHCTo (ORCPT ); Thu, 7 Sep 2023 22:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230380AbjIHCTm (ORCPT ); Thu, 7 Sep 2023 22:19:42 -0400 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78EFD1BD5; Thu, 7 Sep 2023 19:19:35 -0700 (PDT) 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-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1092ffb3-0238-4dc0-baf3-344a653fca3f@kadam.mountain> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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