diff mbox series

power: supply: ucs1002: fix error code in ucs1002_get_property()

Message ID 687f64a4-4c6e-4536-8204-98ad1df934e5@moroto.mountain (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series power: supply: ucs1002: fix error code in ucs1002_get_property() | expand

Commit Message

Dan Carpenter June 19, 2023, 9:44 a.m. UTC
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>
---
From code review.  Untested.

 drivers/power/supply/ucs1002_power.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Sebastian Reichel Sept. 14, 2023, 3:42 p.m. UTC | #1
On Mon, 19 Jun 2023 12:44:17 +0300, Dan Carpenter wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] power: supply: ucs1002: fix error code in ucs1002_get_property()
      commit: e35059949daa83f8dadf710d0f829ab3c3a72fe2

Best regards,
diff mbox series

Patch

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;