summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-06-19 12:44:17 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-09-14 17:38:02 +0200
commite35059949daa83f8dadf710d0f829ab3c3a72fe2 (patch)
treed9517823bc62fdc9bd9db5ec9c83dc2960f04228 /drivers/power
parent4ec7b666fb4247bc6b9cdc84fa753d8dc2994d25 (diff)
downloadlinux-stable-e35059949daa83f8dadf710d0f829ab3c3a72fe2.tar.gz
linux-stable-e35059949daa83f8dadf710d0f829ab3c3a72fe2.tar.bz2
linux-stable-e35059949daa83f8dadf710d0f829ab3c3a72fe2.zip
power: supply: ucs1002: fix error code in ucs1002_get_property()
This function is supposed to return 0 for success instead of returning the val->intval. This makes it the same as the other case statements in this function. Fixes: 81196e2e57fc ("power: supply: ucs1002: fix some health status issues") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/687f64a4-4c6e-4536-8204-98ad1df934e5@moroto.mountain Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/ucs1002_power.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/supply/ucs1002_power.c b/drivers/power/supply/ucs1002_power.c
index 954feba6600b..7970843a4f48 100644
--- a/drivers/power/supply/ucs1002_power.c
+++ b/drivers/power/supply/ucs1002_power.c
@@ -384,7 +384,8 @@ static int ucs1002_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_USB_TYPE:
return ucs1002_get_usb_type(info, val);
case POWER_SUPPLY_PROP_HEALTH:
- return val->intval = info->health;
+ val->intval = info->health;
+ return 0;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = info->present;
return 0;