Commit e3505994 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sebastian Reichel

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: 81196e2e ("power: supply: ucs1002: fix some health status issues")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/687f64a4-4c6e-4536-8204-98ad1df934e5@moroto.mountainSigned-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 4ec7b666
...@@ -384,7 +384,8 @@ static int ucs1002_get_property(struct power_supply *psy, ...@@ -384,7 +384,8 @@ static int ucs1002_get_property(struct power_supply *psy,
case POWER_SUPPLY_PROP_USB_TYPE: case POWER_SUPPLY_PROP_USB_TYPE:
return ucs1002_get_usb_type(info, val); return ucs1002_get_usb_type(info, val);
case POWER_SUPPLY_PROP_HEALTH: case POWER_SUPPLY_PROP_HEALTH:
return val->intval = info->health; val->intval = info->health;
return 0;
case POWER_SUPPLY_PROP_PRESENT: case POWER_SUPPLY_PROP_PRESENT:
val->intval = info->present; val->intval = info->present;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment