platform/x86: wmi: Require query for data blocks, rename writable to setable

The Microsoft WMI documentation requires all data blocks to implement
the Query Control Method (WQxx). If we encounter a data block not
implementing this control method, issue a warning, and ignore the data
block. Remove the "readable" attribute as all data blocks must be
readable (query-able).

Be consistent with the language in the documentation, replace the
"writable" attribute with "setable".

Simplify (flatten) the control flow of wmi_create_device a bit while
we are updating it for the above changes.

Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Darren Hart (VMware) 2017-05-19 19:28:36 -07:00
parent f63019861c
commit fd70da6a62
2 changed files with 71 additions and 69 deletions

View file

@ -22,11 +22,8 @@
struct wmi_device {
struct device dev;
/*
* These are true for data objects that support reads and writes,
* respectively.
*/
bool readable, writeable;
/* True for data blocks implementing the Set Control Method */
bool setable;
};
/* Caller must kfree the result. */