Unverified Commit 578bc2a5 authored by Armin Wolf's avatar Armin Wolf Committed by Ilpo Järvinen
Browse files

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: default avatarArmin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260406203237.2970-3-W_Armin@gmx.de


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 7e2d964f
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -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;

	memcpy(output, out_data, sizeof(*output));
	}

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -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;