History

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.

Mattias Jacobsson committed 7 years ago

Commit eacc95e1 parent 841f1b84 files · +15 −5Browse files

Showing the changes to include/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/linux/mod_devicetable.h +12 −0
  2. include/linux/wmi.h +1 −4
include/linux/mod_devicetable.h+12−0
@@ -779,4 +779,16 @@ struct typec_device_id { · 778 unmodified lines
779 kernel_ulong_t driver_data;779 kernel_ulong_t driver_data;
780};780};
781 781
782/* WMI */
783
784#define WMI_MODULE_PREFIX "wmi:"
785
786/**
787 * struct wmi_device_id - WMI device identifier
788 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
789 */
790struct wmi_device_id {
791 const char guid_string[UUID_STRING_LEN+1];
792};
793
782#endif /* LINUX_MOD_DEVICETABLE_H */794#endif /* LINUX_MOD_DEVICETABLE_H */
include/linux/wmi.h+1−4
@@ -18,6 +18,7 @@ · 17 unmodified lines
18 18
19#include <linux/device.h>19#include <linux/device.h>
20#include <linux/acpi.h>20#include <linux/acpi.h>
21#include <linux/mod_devicetable.h>
21#include <uapi/linux/wmi.h>22#include <uapi/linux/wmi.h>
22 23
23struct wmi_device {24struct wmi_device {
@@ -39,10 +40,6 @@ extern union acpi_object *wmidev_block_query(struct wmi_device *wdev, · 15 unmodified lines
39 40
40extern int set_required_buffer_size(struct wmi_device *wdev, u64 length);41extern int set_required_buffer_size(struct wmi_device *wdev, u64 length);
41 42
42struct wmi_device_id {
43 const char *guid_string;
44};
45
46struct wmi_driver {43struct wmi_driver {
47 struct device_driver driver;44 struct device_driver driver;
48 const struct wmi_device_id *id_table;45 const struct wmi_device_id *id_table;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t