mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 03:11:11 -04:00
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>
This commit is contained in:
committed by
Ilpo Järvinen
parent
7e2d964f41
commit
578bc2a53a
@@ -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;
|
||||
out_data = out_buf.data;
|
||||
if (out_buf.length < sizeof(*output))
|
||||
return -EIO;
|
||||
|
||||
if (out_buf.length < sizeof(*output))
|
||||
return -EIO;
|
||||
|
||||
memcpy(output, out_data, sizeof(*output));
|
||||
}
|
||||
memcpy(output, out_data, sizeof(*output));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user