platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h

In preparation for adding WMI support to MODULE_DEVICE_TABLE() move the
definition of struct wmi_device_id to mod_devicetable.h and inline
guid_string in the struct.

Changing guid_string to an inline char array changes the loop conditions
when looping over an array of struct wmi_device_id. Therefore update
wmi_dev_match()'s loop to check for an empty guid_string instead of a
NULL pointer.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
[dvhart: Move UUID_STRING_LEN define to this patch]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
This commit is contained in:
Mattias Jacobsson
2019-02-19 20:59:49 +01:00
committed by Darren Hart (VMware)
parent 841f1b8fb4
commit eacc95eae6
4 changed files with 15 additions and 5 deletions

View File

@@ -779,4 +779,16 @@ struct typec_device_id {
kernel_ulong_t driver_data;
};
/* WMI */
#define WMI_MODULE_PREFIX "wmi:"
/**
* struct wmi_device_id - WMI device identifier
* @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
*/
struct wmi_device_id {
const char guid_string[UUID_STRING_LEN+1];
};
#endif /* LINUX_MOD_DEVICETABLE_H */