Skip to content

Commit 578bc2a

Browse files
Wer-Wolfij-intel
authored andcommitted
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>
1 parent 7e2d964 commit 578bc2a

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

drivers/platform/x86/bitland-mifs-wmi.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,23 +167,24 @@ static int bitland_mifs_wmi_call(struct bitland_mifs_wmi_data *data,
167167
struct bitland_mifs_output *output)
168168
{
169169
struct wmi_buffer in_buf = { .length = sizeof(*input), .data = (void *)input };
170+
void *out_data __free(kfree) = NULL;
170171
struct wmi_buffer out_buf = { 0 };
171172
int ret;
172173

173174
guard(mutex)(&data->lock);
174175

175-
ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, output ? &out_buf : NULL);
176+
if (!output)
177+
return wmidev_invoke_procedure(data->wdev, 0, 1, &in_buf);
178+
179+
ret = wmidev_invoke_method(data->wdev, 0, 1, &in_buf, &out_buf);
176180
if (ret)
177181
return ret;
178182

179-
if (output) {
180-
void *out_data __free(kfree) = out_buf.data;
181-
182-
if (out_buf.length < sizeof(*output))
183-
return -EIO;
183+
out_data = out_buf.data;
184+
if (out_buf.length < sizeof(*output))
185+
return -EIO;
184186

185-
memcpy(output, out_data, sizeof(*output));
186-
}
187+
memcpy(output, out_data, sizeof(*output));
187188

188189
return 0;
189190
}

drivers/platform/x86/intel/wmi/thunderbolt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static ssize_t force_power_store(struct device *dev,
3434
if (mode > 1)
3535
return -EINVAL;
3636

37-
ret = wmidev_invoke_method(to_wmi_device(dev), 0, 1, &buffer, NULL);
37+
ret = wmidev_invoke_procedure(to_wmi_device(dev), 0, 1, &buffer);
3838
if (ret < 0)
3939
return ret;
4040

0 commit comments

Comments
 (0)