All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: supply: ucs1002: fix error code in ucs1002_get_property()
@ 2023-06-19  9:44 Dan Carpenter
  2023-09-14 15:42 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-06-19  9:44 UTC (permalink / raw)
  To: Lucas Stach; +Cc: Sebastian Reichel, linux-pm, kernel-janitors

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(-)

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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: ucs1002: fix error code in ucs1002_get_property()
  2023-06-19  9:44 [PATCH] power: supply: ucs1002: fix error code in ucs1002_get_property() Dan Carpenter
@ 2023-09-14 15:42 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2023-09-14 15:42 UTC (permalink / raw)
  To: Lucas Stach, Dan Carpenter; +Cc: Sebastian Reichel, linux-pm, kernel-janitors


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,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-14 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19  9:44 [PATCH] power: supply: ucs1002: fix error code in ucs1002_get_property() Dan Carpenter
2023-09-14 15:42 ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.