platform/x86: wmi: Add to_wmi_device() helper macro
[sfrench/cifs-2.6.git] / include / linux / wmi.h
index 207544968268a61e54e775527780211270919549..8a643c39fccedb7a98b7b83f762217f7c23808b0 100644 (file)
@@ -27,6 +27,14 @@ struct wmi_device {
        bool setable;
 };
 
+/**
+ * to_wmi_device() - Helper macro to cast a device to a wmi_device
+ * @device: device struct
+ *
+ * Cast a struct device to a struct wmi_device.
+ */
+#define to_wmi_device(device)  container_of(device, struct wmi_device, dev)
+
 extern acpi_status wmidev_evaluate_method(struct wmi_device *wdev,
                                          u8 instance, u32 method_id,
                                          const struct acpi_buffer *in,