diff options
| author | Xueqin Luo <luoxueqin@kylinos.cn> | 2026-09-01 15:29:54 +0800 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-09-10 00:50:30 +0200 |
| commit | a58cbc8b36ec0cd00d2ba3de7d003de818a27523 (patch) | |
| tree | 694b229667405630a87f2c61160901b0a24d3476 | |
| parent | 45d4af4e80a25881b6b75e8e34872c555c43a41d (diff) | |
| download | linux-next-a58cbc8b36ec0cd00d2ba3de7d003de818a27523.tar.gz linux-next-a58cbc8b36ec0cd00d2ba3de7d003de818a27523.zip | |
power: supply: ds2780: Fix ds2780_get_capacity() returning raw value
ds2780_get_capacity() returns the raw register value instead of 0 on
success. The capacity is already stored in *capacity, so the function
should return 0 to indicate success.
Fixes: 275ac74629c4 ("w1: add Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC support")
Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
Link: https://patch.msgid.link/20260901072954.1953121-1-luoxueqin@kylinos.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| -rw-r--r-- | drivers/power/supply/ds2780_battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/ds2780_battery.c b/drivers/power/supply/ds2780_battery.c index 5b57bbba79d4..ef2446386c2a 100644 --- a/drivers/power/supply/ds2780_battery.c +++ b/drivers/power/supply/ds2780_battery.c @@ -304,7 +304,7 @@ static int ds2780_get_capacity(struct ds2780_device_info *dev_info, return ret; *capacity = raw; - return raw; + return 0; } static int ds2780_get_status(struct ds2780_device_info *dev_info, int *status) |
