Fix return values of charging id funcs

This commit is contained in:
Christoffer Sandberg 2023-02-16 17:14:33 +01:00
parent 852cba4523
commit a14e6a0298

View file

@ -808,17 +808,21 @@ static int uw_has_charging_priority(bool *status)
|| dmi_match(DMI_PRODUCT_NAME, "A60 MUV") || dmi_match(DMI_PRODUCT_NAME, "A60 MUV")
; ;
if (not_supported_device) if (not_supported_device) {
return false; *status = false;
return 0;
}
result = uniwill_read_ec_ram(0x0742, &data); result = uniwill_read_ec_ram(0x0742, &data);
if (result != 0)
return -EIO;
if (data & (1 << 5)) if (data & (1 << 5))
*status = true; *status = true;
else else
*status = false; *status = false;
return result; return 0;
} }
static bool uw_charging_profile_loaded = false; static bool uw_charging_profile_loaded = false;
@ -865,17 +869,21 @@ static int uw_has_charging_profile(bool *status)
|| dmi_match(DMI_PRODUCT_NAME, "A60 MUV") || dmi_match(DMI_PRODUCT_NAME, "A60 MUV")
; ;
if (not_supported_device) if (not_supported_device) {
return false; *status = false;
return 0;
}
result = uniwill_read_ec_ram(0x078e, &data); result = uniwill_read_ec_ram(0x078e, &data);
if (result != 0)
return -EIO;
if (data & (1 << 3)) if (data & (1 << 3))
*status = true; *status = true;
else else
*status = false; *status = false;
return result; return 0;
} }
struct char_to_u8_t { struct char_to_u8_t {