From: Armin Wolf <W_Armin@gmx.de>
To: jithu.joseph@intel.com, maurice.ma@intel.com,
hdegoede@redhat.com, markgross@kernel.org,
ilpo.jarvinen@linux.intel.com
Cc: Dell.Client.Kernel@dell.com, platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] platform/x86: wmi: Add to_wmi_device() helper macro
Date: Thu, 2 Nov 2023 05:29:57 +0100 [thread overview]
Message-ID: <20231102042959.11816-2-W_Armin@gmx.de> (raw)
In-Reply-To: <20231102042959.11816-1-W_Armin@gmx.de>
Add a helper macro for WMI drivers to cast a device to
the corresponding WMI device. This should replace some
boilerplate code.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
include/linux/wmi.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/wmi.h b/include/linux/wmi.h
index 207544968268..8a643c39fcce 100644
--- a/include/linux/wmi.h
+++ b/include/linux/wmi.h
@@ -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,
--
2.39.2
next prev parent reply other threads:[~2023-11-02 4:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 4:29 [PATCH 1/4] platform/x86: wmi: Add wmidev_block_set() Armin Wolf
2023-11-02 4:29 ` Armin Wolf [this message]
2023-11-02 4:29 ` [PATCH 3/4] platform/x86: intel-wmi-sbl-fw-update: Use bus-based WMI interface Armin Wolf
2023-11-02 18:49 ` Joseph, Jithu
2023-11-02 4:29 ` [PATCH 4/4] platform/x86/intel/wmi: thunderbolt: " Armin Wolf
2023-11-02 13:28 ` Mario Limonciello
2023-11-02 19:08 ` [PATCH 1/4] platform/x86: wmi: Add wmidev_block_set() Joseph, Jithu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231102042959.11816-2-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--cc=Dell.Client.Kernel@dell.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jithu.joseph@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=maurice.ma@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®