linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] power: supply: sbs-battery: Silence warning about unknown chemistry
@ 2021-05-10 22:08 Dmitry Osipenko
  2021-05-10 22:08 ` [PATCH v1 2/2] power: supply: sbs-battery: Fall back to Li-ion battery type for bq20z75 Dmitry Osipenko
  2021-05-13 15:11 ` [PATCH v1 1/2] power: supply: sbs-battery: Silence warning about unknown chemistry Sebastian Reichel
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2021-05-10 22:08 UTC (permalink / raw)
  To: Sebastian Reichel, Antoni Aloy Torrens, Nikola Milosavljević
  Cc: linux-pm, linux-kernel

Older variants of controller don't support reporting type of the battery.
Make warning message about unknown chemistry to be printed only once in
order to stop flooding kernel log with the message on each request of the
property. This patch fixes the noisy messages on Asus Transformer TF101.

Tested-by: Antoni Aloy Torrens <aaloytorrens@gmail.com> # TF101
Tested-by: Nikola Milosavljević <mnidza@outlook.com> # TF101
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/power/supply/sbs-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index 8d7a10730e43..b71fbf543428 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -814,7 +814,7 @@ static int sbs_get_chemistry(struct i2c_client *client,
 		val->intval = POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
 
 	if (val->intval == POWER_SUPPLY_TECHNOLOGY_UNKNOWN)
-		dev_warn(&client->dev, "Unknown chemistry: %s\n", chemistry);
+		dev_warn_once(&client->dev, "Unknown chemistry: %s\n", chemistry);
 
 	return 0;
 }
-- 
2.30.2


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

end of thread, other threads:[~2021-05-14 13:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 22:08 [PATCH v1 1/2] power: supply: sbs-battery: Silence warning about unknown chemistry Dmitry Osipenko
2021-05-10 22:08 ` [PATCH v1 2/2] power: supply: sbs-battery: Fall back to Li-ion battery type for bq20z75 Dmitry Osipenko
2021-05-13 15:31   ` Sebastian Reichel
2021-05-14 13:16     ` Dmitry Osipenko
2021-05-13 15:11 ` [PATCH v1 1/2] power: supply: sbs-battery: Silence warning about unknown chemistry Sebastian Reichel
2021-05-14 13:13   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).