diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/platform/x86/bitland-mifs-wmi.c | 17 | ||||
| -rw-r--r-- | drivers/platform/x86/intel/wmi/thunderbolt.c | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c index 54380708b7b0..cd3cdd087511 100644 --- a/drivers/platform/x86/bitland-mifs-wmi.c +++ b/drivers/platform/x86/bitland-mifs-wmi.c @@ -167,23 +167,24 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data, struct bitland_mifs_output *output) { struct wmi_buffer in_buf = { .length = sizeof(*input), .data = (void *)input }; + void *out_data __free(kfree) = NULL; struct wmi_buffer out_buf = { 0 }; int ret; guard(mutex)(&data->lock); - ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, output ? &out_buf : NULL); + if (!output) + return wmidev_invoke_procedure(data->wdev, 0, 1, &in_buf); + + ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, &out_buf); if (ret) return ret; - if (output) { - void *out_data __free(kfree) = out_buf.data; - - if (out_buf.length < sizeof(*output)) - return -EIO; + out_data = out_buf.data; + if (out_buf.length < sizeof(*output)) + return -EIO; - memcpy(output, out_data, sizeof(*output)); - } + memcpy(output, out_data, sizeof(*output)); return 0; } diff --git a/drivers/platform/x86/intel/wmi/thunderbolt.c b/drivers/platform/x86/intel/wmi/thunderbolt.c index 47017f2d7597..9b1920d61674 100644 --- a/drivers/platform/x86/intel/wmi/thunderbolt.c +++ b/drivers/platform/x86/intel/wmi/thunderbolt.c @@ -34,7 +34,7 @@ static ssize_t force_power_store(struct device *dev, if (mode > 1) return -EINVAL; - ret = wmidev_invoke_method(to_wmi_device(dev), 0, 1, &buffer, NULL); + ret = wmidev_invoke_procedure(to_wmi_device(dev), 0, 1, &buffer); if (ret < 0) return ret; |
