Skip to content

Commit

Permalink
power: supply: sbs-battery: Silence warning about unknown chemistry
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Dmitry Osipenko <[email protected]>
  • Loading branch information
digetx committed Apr 1, 2021
1 parent 7161e0e commit 946b1ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/sbs-battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 946b1ed

Please sign in to comment.