From patchwork Thu Apr 19 23:43:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 10351691 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9997A60244 for ; Thu, 19 Apr 2018 23:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DA952855D for ; Thu, 19 Apr 2018 23:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 825C928574; Thu, 19 Apr 2018 23:43:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3BC52855D for ; Thu, 19 Apr 2018 23:43:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753666AbeDSXn3 (ORCPT ); Thu, 19 Apr 2018 19:43:29 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34378 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753636AbeDSXn2 (ORCPT ); Thu, 19 Apr 2018 19:43:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YlLOoKRllheMqO2/ycUDW9VjufOT202YaHE9kJwMgDY=; b=aA61SEoXEGNYaeWzwcv1brZyI Yj4iCoZ6+DgpYfCMZ+EsdtRlzCscM1hKyTPzv0pbcK4RUq0nPHhGN8cY3Xrq9qtWoGZ1qLTLnoXRw L0UZBNKlE0AwQCrh4E4U0v5Rc12ktf0aeF7jEwGhxECQ/9ZEEksB4cEOfKNn6Xu13HruXlbYc5nUi fqUI+QB4dVz4NvRJ6shxov0Gf8ZZBRnrH53FZLZ+EZoILWgoL+qWYMzf9IB2Cz1D8FIb7wpx1WyiM RFQY2CcONdpM8dH/9HEguqpuIecMb/3gueRgNJW8dVBlOvVJtUAYsH1Il9bZlG+BSvjjA5Z+prlhZ AoAl8dqTw==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9JD5-0001Q8-5A; Thu, 19 Apr 2018 23:43:27 +0000 Date: Thu, 19 Apr 2018 16:43:24 -0700 From: Darren Hart To: Mario Limonciello Cc: Andy Shevchenko , LKML , platform-driver-x86@vger.kernel.org Subject: Re: [PATCH] platform/x86: dell-smbios: Match on www.dell.com in OEM strings too Message-ID: <20180419234324.GA11546@fury> References: <1523994356-9598-1-git-send-email-mario.limonciello@dell.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1523994356-9598-1-git-send-email-mario.limonciello@dell.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Apr 17, 2018 at 02:45:56PM -0500, Mario Limonciello wrote: > Sergey reported that some much older Dell systems don't support > the OEM string "Dell System" but instead supported www.dell.com > in OEM strings. > > Match both of these to indicate that this driver is running on > a Dell system. > > Reported-by: Sergey Kubushyn > Signed-off-by: Mario Limonciello > Tested-by: Sergey Kubushyn > --- > drivers/platform/x86/dell-smbios-base.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/x86/dell-smbios-base.c b/drivers/platform/x86/dell-smbios-base.c > index 2485c80..fbd6557 100644 > --- a/drivers/platform/x86/dell-smbios-base.c > +++ b/drivers/platform/x86/dell-smbios-base.c > @@ -555,11 +555,15 @@ static void free_group(struct platform_device *pdev) > > static int __init dell_smbios_init(void) > { > - const struct dmi_device *valid; > + const struct dmi_device *valid_dell_system; > + const struct dmi_device *valid_www; > int ret, wmi, smm; > > - valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL); > - if (!valid) { > + valid_dell_system = > + dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL); > + valid_www = > + dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL); > + if (!valid_dell_system && !valid_www) { > pr_err("Unable to run on non-Dell system\n"); > return -ENODEV; > } Hrm, rather than introduce another variable that we don't use and always perform both tests, when most of the time we only need to do the first, how about something like: From 2cb5959dadec769167350a9bcb1d212a02b17af8 Mon Sep 17 00:00:00 2001 Message-Id: <2cb5959dadec769167350a9bcb1d212a02b17af8.1524181265.git.dvhart@infradead.org> From: Mario Limonciello Date: Tue, 17 Apr 2018 14:45:56 -0500 Subject: [PATCH] platform/x86: dell-smbios: Match on www.dell.com in OEM strings too Sergey reported that some much older Dell systems don't support the OEM string "Dell System" but instead supported www.dell.com in OEM strings. Match both of these to indicate that this driver is running on a Dell system. Reported-by: Sergey Kubushyn Tested-by: Sergey Kubushyn Signed-off-by: Mario Limonciello [dvhart: Simplify DMI logic and eliminate unnecessary variables] Signed-off-by: Darren Hart (VMware) --- drivers/platform/x86/dell-smbios-base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/dell-smbios-base.c b/drivers/platform/x86/dell-smbios-base.c index 33fb2a20458a..9dc282ed5a9e 100644 --- a/drivers/platform/x86/dell-smbios-base.c +++ b/drivers/platform/x86/dell-smbios-base.c @@ -555,11 +555,10 @@ static void free_group(struct platform_device *pdev) static int __init dell_smbios_init(void) { - const struct dmi_device *valid; int ret, wmi, smm; - valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL); - if (!valid) { + if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) && + !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) { pr_err("Unable to run on non-Dell system\n"); return -ENODEV; }