diff options
| author | Armin Wolf <W_Armin@gmx.de> | 2026-04-06 22:32:33 +0200 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-04-13 14:11:20 +0300 |
| commit | 578bc2a53ae286e438024d363ad0513f7105e6dc (patch) | |
| tree | 5f40db93ec6d386d31134f97b0a7673e40d8c051 /drivers/platform/x86 | |
| parent | 7e2d964f417ec13763eecfecc5d2813f63cb8da0 (diff) | |
platform/wmi: Convert drivers to use wmidev_invoke_procedure()
Convert users of wmidev_invoke_method() to wmidev_invoke_procedure()
where applicable to prepare for future changes.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260406203237.2970-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
| -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; |
