mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Crag Wang <crag0715@gmail.com>,
	prasanth.ksr@dell.com, hdegoede@redhat.com,
	Dell.Client.Kernel@dell.com
Cc: LKML <linux-kernel@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	Crag Wang <crag_wang@dell.com>
Subject: Re: [PATCH] platform/x86: dell-sysman: add support for alienware products
Date: Mon, 23 Sep 2024 08:27:08 -0500	[thread overview]
Message-ID: <7c8b8824-2204-448b-92a4-33b27e3df834@amd.com> (raw)
In-Reply-To: <20240923063658.411071-1-crag_wang@dell.com>

On 9/23/2024 01:36, Crag Wang wrote:
> Use SMBIOS Type 1 manfacturer instead OEM strings to verify product
> compatibility. Also, add Alienware products to the support scope.

Alienware systems don't use OEM string "Dell System"?  TIL.

> 
> Signed-off-by: Crag Wang <crag_wang@dell.com>
> ---
>   .../x86/dell/dell-wmi-sysman/sysman.c         | 19 +++++++++++++++++--
>   1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> index 9def7983d7d6..2f3f7e307b29 100644
> --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> @@ -516,12 +516,27 @@ static int init_bios_attributes(int attr_type, const char *guid)
>   	return retval;
>   }
>   
> +static const struct dmi_system_id sysman_dev_table[] __initconst = {
> +	{
> +		.ident = "Dell Inc.",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +		},
> +	},
> +	{
> +		.ident = "Alienware",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
> +		},
> +	},
> +	{}
> +};
> +
>   static int __init sysman_init(void)
>   {
>   	int ret = 0;
>   
> -	if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) &&
> -	    !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) {
> +	if (!dmi_check_system(sysman_dev_table)) {

Would it perhaps make sense to be an && condition instead of remove the 
dmi_find_device() conditions?

IE:

if (!dmi_find_device() && !dmi_find_device() && !dmi_check_system())

Then you can continue to cover anything that has been rebranded too.

>   		pr_err("Unable to run on non-Dell system\n");
>   		return -ENODEV;
>   	}


  reply	other threads:[~2024-09-23 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23  6:36 Crag Wang
2024-09-23 13:27 ` Mario Limonciello [this message]
2024-09-24  0:45   ` Wang, Crag
2024-10-08  4:31   ` Ksr, Prasanth
2024-09-24  5:02 ` [PATCHv2 1/1] " Crag Wang
2024-09-24 13:24   ` Mario Limonciello
2024-09-24 14:34     ` Tudor, Laurentiu
2024-09-24 14:42       ` Wang, Crag
2024-10-03 11:03         ` Ilpo Järvinen

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=7c8b8824-2204-448b-92a4-33b27e3df834@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Dell.Client.Kernel@dell.com \
    --cc=crag0715@gmail.com \
    --cc=crag_wang@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=prasanth.ksr@dell.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®