Fix return variables

This commit is contained in:
Werner Sembach 2022-09-21 18:17:27 +02:00
parent 6aacbedc25
commit f2c442bc2a

View file

@ -42,11 +42,11 @@ static bool uniwill_ec_direct = true;
DEFINE_MUTEX(uniwill_ec_lock); DEFINE_MUTEX(uniwill_ec_lock);
static u32 uw_wmi_ec_evaluate(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, u8 read_flag, u32 *return_buffer) static int uw_wmi_ec_evaluate(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, u8 read_flag, u32 *return_buffer)
{ {
acpi_status status; acpi_status status;
union acpi_object *out_acpi; union acpi_object *out_acpi;
u32 e_result = 0; int e_result = 0;
// Kernel buffer for input argument // Kernel buffer for input argument
u32 *wmi_arg = (u32 *) kmalloc(sizeof(u32)*10, GFP_KERNEL); u32 *wmi_arg = (u32 *) kmalloc(sizeof(u32)*10, GFP_KERNEL);
@ -97,10 +97,10 @@ static u32 uw_wmi_ec_evaluate(u8 addr_low, u8 addr_high, u8 data_low, u8 data_hi
/** /**
* EC address read through WMI * EC address read through WMI
*/ */
static u32 uw_ec_read_addr_wmi(u8 addr_low, u8 addr_high, union uw_ec_read_return *output) static int uw_ec_read_addr_wmi(u8 addr_low, u8 addr_high, union uw_ec_read_return *output)
{ {
u32 uw_data[10]; u32 uw_data[10];
u32 ret = uw_wmi_ec_evaluate(addr_low, addr_high, 0x00, 0x00, 1, uw_data); int ret = uw_wmi_ec_evaluate(addr_low, addr_high, 0x00, 0x00, 1, uw_data);
output->dword = uw_data[0]; output->dword = uw_data[0];
// pr_debug("addr: 0x%02x%02x value: %0#4x (high: %0#4x) result: %d\n", addr_high, addr_low, output->bytes.data_low, output->bytes.data_high, ret); // pr_debug("addr: 0x%02x%02x value: %0#4x (high: %0#4x) result: %d\n", addr_high, addr_low, output->bytes.data_low, output->bytes.data_high, ret);
return ret; return ret;
@ -109,10 +109,10 @@ static u32 uw_ec_read_addr_wmi(u8 addr_low, u8 addr_high, union uw_ec_read_retur
/** /**
* EC address write through WMI * EC address write through WMI
*/ */
static u32 uw_ec_write_addr_wmi(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, union uw_ec_write_return *output) static int uw_ec_write_addr_wmi(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, union uw_ec_write_return *output)
{ {
u32 uw_data[10]; u32 uw_data[10];
u32 ret = uw_wmi_ec_evaluate(addr_low, addr_high, data_low, data_high, 0, uw_data); int ret = uw_wmi_ec_evaluate(addr_low, addr_high, data_low, data_high, 0, uw_data);
output->dword = uw_data[0]; output->dword = uw_data[0];
return ret; return ret;
} }
@ -120,9 +120,9 @@ static u32 uw_ec_write_addr_wmi(u8 addr_low, u8 addr_high, u8 data_low, u8 data_
/** /**
* Direct EC address read * Direct EC address read
*/ */
static u32 uw_ec_read_addr_direct(u8 addr_low, u8 addr_high, union uw_ec_read_return *output) static int uw_ec_read_addr_direct(u8 addr_low, u8 addr_high, union uw_ec_read_return *output)
{ {
u32 result; int result;
u8 tmp, count, flags; u8 tmp, count, flags;
mutex_lock(&uniwill_ec_lock); mutex_lock(&uniwill_ec_lock);
@ -163,9 +163,9 @@ static u32 uw_ec_read_addr_direct(u8 addr_low, u8 addr_high, union uw_ec_read_re
return result; return result;
} }
static u32 uw_ec_write_addr_direct(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, union uw_ec_write_return *output) static int uw_ec_write_addr_direct(u8 addr_low, u8 addr_high, u8 data_low, u8 data_high, union uw_ec_write_return *output)
{ {
u32 result = 0; int result = 0;
u8 tmp, count, flags; u8 tmp, count, flags;
mutex_lock(&uniwill_ec_lock); mutex_lock(&uniwill_ec_lock);
@ -206,9 +206,9 @@ static u32 uw_ec_write_addr_direct(u8 addr_low, u8 addr_high, u8 data_low, u8 da
return result; return result;
} }
u32 uw_wmi_read_ec_ram(u16 addr, u8 *data) int uw_wmi_read_ec_ram(u16 addr, u8 *data)
{ {
u32 result; int result;
u8 addr_low, addr_high; u8 addr_low, addr_high;
union uw_ec_read_return output; union uw_ec_read_return output;
@ -228,9 +228,9 @@ u32 uw_wmi_read_ec_ram(u16 addr, u8 *data)
return result; return result;
} }
u32 uw_wmi_write_ec_ram(u16 addr, u8 data) int uw_wmi_write_ec_ram(u16 addr, u8 data)
{ {
u32 result; int result;
u8 addr_low, addr_high, data_low, data_high; u8 addr_low, addr_high, data_low, data_high;
union uw_ec_write_return output; union uw_ec_write_return output;