From: "Pali Rohár" <pali.rohar@gmail.com>
To: Mattias Jacobsson <2pi@mok.nu>
Cc: yamada.masahiro@socionext.com, michal.lkml@markovi.net,
dvhart@infradead.org, andy@infradead.org,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE()
Date: Sun, 20 Jan 2019 10:00:02 +0100 [thread overview]
Message-ID: <20190120090002.imufwdnvtufjgoxh@pali> (raw)
In-Reply-To: <ff56fb53485ec75b5e8a81f306983aa7976574c5.1547827336.git.2pi@mok.nu>
[-- Attachment #1: Type: text/plain, Size: 2846 bytes --]
On Saturday 19 January 2019 12:55:54 Mattias Jacobsson wrote:
> Add WMI support to MODULE_DEVICE_TABLE() by adding info about struct
> wmi_device_id in devicetable-offsets.c and add a WMI entry point in
> file2alias.c.
>
> The type argument for MODULE_DEVICE_TABLE(type, name) is wmi.
>
> Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
> ---
>
> The idea of adding wmi support to MODULE_DEVICE_TABLE() originates from
> a suggestion at [1].
Thanks for implementation!
> However [2] states: "Please note that this tag
> should not be added without the reporter's permission, especially if
> the idea was not posted in a public forum." about the "Suggested-by:"
> tag.
> Pali Rohár: May I add a "Suggested-by:" tag?
Yes, you can!
> [1]: https://lore.kernel.org/patchwork/patch/795892/#989423
> [2]: Documentation/process/submitting-patches.rst
>
> ---
> scripts/mod/devicetable-offsets.c | 3 +++
> scripts/mod/file2alias.c | 18 ++++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> index 293004499b4d..99276a422e77 100644
> --- a/scripts/mod/devicetable-offsets.c
> +++ b/scripts/mod/devicetable-offsets.c
> @@ -225,5 +225,8 @@ int main(void)
> DEVID_FIELD(typec_device_id, svid);
> DEVID_FIELD(typec_device_id, mode);
>
> + DEVID(wmi_device_id);
> + DEVID_FIELD(wmi_device_id, guid_string);
> +
> return 0;
> }
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index a37af7d71973..f014a2466ff7 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -1287,6 +1287,23 @@ static int do_typec_entry(const char *filename, void *symval, char *alias)
> return 1;
> }
>
> +/* Looks like: wmi:guid */
> +static int do_wmi_entry(const char *filename, void *symval, char *alias)
> +{
> + DEF_FIELD_ADDR(symval, wmi_device_id, guid_string);
> + if (strlen(*guid_string) != WMI_GUID_STRING_LEN) {
> + warn("Invalid WMI device id 'wmi:%s' in '%s'\n",
> + *guid_string, filename);
> + return 0;
> + }
> + if (snprintf(alias, 500, WMI_MODULE_PREFIX "%s", *guid_string) < 0) {
> + warn("Could not generate all MODULE_ALIAS's in '%s'\n",
> + filename);
> + return 0;
> + }
> + return 1;
> +}
> +
> /* Does namelen bytes of name exactly match the symbol? */
> static bool sym_is(const char *name, unsigned namelen, const char *symbol)
> {
> @@ -1357,6 +1374,7 @@ static const struct devtable devtable[] = {
> {"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry},
> {"tbsvc", SIZE_tb_service_id, do_tbsvc_entry},
> {"typec", SIZE_typec_device_id, do_typec_entry},
> + {"wmi", SIZE_wmi_device_id, do_wmi_entry},
> };
>
> /* Create MODULE_ALIAS() statements.
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2019-01-20 9:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-19 11:55 [PATCH 0/3] " Mattias Jacobsson
2019-01-19 11:55 ` [PATCH 1/3] platform/x86: wmi: move struct wmi_device_id to mod_devicetable.h Mattias Jacobsson
2019-01-22 20:28 ` Mattias Jacobsson
2019-01-19 11:55 ` [PATCH 2/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE() Mattias Jacobsson
2019-01-20 9:00 ` Pali Rohár [this message]
2019-01-19 11:55 ` [PATCH 3/3] platform/x86: wmi: use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() Mattias Jacobsson
2019-01-21 21:54 ` Mario.Limonciello
2019-01-26 21:06 ` [PATCH 0/3] platform/x86: wmi: add WMI support to MODULE_DEVICE_TABLE() Darren Hart
2019-01-27 19:15 ` Mattias Jacobsson
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=20190120090002.imufwdnvtufjgoxh@pali \
--to=pali.rohar@gmail.com \
--cc=2pi@mok.nu \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=platform-driver-x86@vger.kernel.org \
--cc=yamada.masahiro@socionext.com \
/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®