public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] power: supply: mt6370: Fix missing error code in mt6370_chg_toggle_cfo()
@ 2023-09-06  8:48 Harshit Mogalapalli
  2023-09-07 10:43 ` AngeloGioacchino Del Regno
  2023-09-11 20:15 ` Sebastian Reichel
  0 siblings, 2 replies; 6+ messages in thread
From: Harshit Mogalapalli @ 2023-09-06  8:48 UTC (permalink / raw)
  To: Sebastian Reichel, Matthias Brugger, AngeloGioacchino Del Regno,
	Andy Shevchenko, ChiaEn Wu, linux-pm, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: dan.carpenter, kernel-janitors, error27, harshit.m.mogalapalli

When mt6370_chg_field_get() suceeds, ret is set to zero and returning
zero when flash led is still in strobe mode looks incorrect.

Fixes: 233cb8a47d65 ("power: supply: mt6370: Add MediaTek MT6370 charger driver")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
This is based on static analysis with smatch, only compile tested.
---
 drivers/power/supply/mt6370-charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 	}
 
 	/* cfo off */
-- 
2.39.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-11 20:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06  8:48 [PATCH] power: supply: mt6370: Fix missing error code in mt6370_chg_toggle_cfo() Harshit Mogalapalli
2023-09-07 10:43 ` AngeloGioacchino Del Regno
2023-09-07 11:08   ` Dan Carpenter
2023-09-08  2:19     ` ChiaEn Wu
2023-09-08 10:01       ` AngeloGioacchino Del Regno
2023-09-11 20:15 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox