Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2406371ybl; Mon, 20 Jan 2020 02:18:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxjTIXBYnj2C8n/rMdwtORor6q/s0bBksAnnS1rXqUyJckEIy3wedbXFt8E6Dvt1Q9PQpV3 X-Received: by 2002:a05:6830:151a:: with SMTP id k26mr16157094otp.74.1579515511070; Mon, 20 Jan 2020 02:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579515511; cv=none; d=google.com; s=arc-20160816; b=bQ/Qd41GCEW0hn2MYB7UNJgJos0mgaX2x0SuaPRuMeLpCPtEGCG4oiJWG1JbNvldQO dJZIAj8zoyeORVt1J/6zQeaZZTxx1uvBjAjXwmcrbM7R0k08LJprlL/GxL1mXyshljWn tVhZJxDH/yt0aHHmTsqcWcaLv/26G3qHaaN86n6vrb3eEUmFClTGiKKdX+CQheHgzIwk zNSgcLX1uL64qDIhnr95qUuWxe1e8x5iVRdjjgFVnd2iiQCCR4r4MkRvTrh5Afj1vu44 IN2qmoj3rISMSj53VVUqyxRjDGxNwujgb+zsF6BgGGIx76hk7Yj+T/SMD2SbK1FftZL2 46lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5knnSUzhZcxiUYbbTXfg8vmR0PTwCcfC5imMro4xCNg=; b=ihuM/r2fvnwpjx9qqUdLb7A9niPYU7JX5J20hM8VcGYCZidSSTW/rNVwUVq2lAXxCy UE9gxBNVMSdUSyKnzPyWcdd5x+5qmU0Joc2Nxf12NvQxVRYjGz56lSwM3+Au2FSlgcws SEH/WwgNimuKZW+d+x4ca/ujoIPFuHUDKZYU9gDMVRoQ97Y0wtKVBGWb3zwG/8zzkW4M os4wbcQs952pbrAsqAHUrGG3/eg86OFRUxFV0u9MpuxsLZ0nSmqgcAF8zgiHiNDnTAtI nQ3yaCcPXdgu+dyaVWyAxe9iPAEqBe4ki4aEEdYkIZcUNuCtOnJv/Kr2Zuyg9/+jj3Wm oI5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si18366772otf.42.2020.01.20.02.18.18; Mon, 20 Jan 2020 02:18:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbgATKRS (ORCPT + 99 others); Mon, 20 Jan 2020 05:17:18 -0500 Received: from mga14.intel.com ([192.55.52.115]:37462 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgATKRS (ORCPT ); Mon, 20 Jan 2020 05:17:18 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 02:17:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,341,1574150400"; d="scan'208";a="227015778" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003.jf.intel.com with ESMTP; 20 Jan 2020 02:17:13 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1itU7O-0000Dw-8J; Mon, 20 Jan 2020 12:17:14 +0200 Date: Mon, 20 Jan 2020 12:17:14 +0200 From: Andy Shevchenko To: Pierre-Louis Bossart Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, "Guilherme G . Piccoli" , linux-kernel@vger.kernel.org, Cezary Rojewski , Liam Girdwood , Jie Yang , Mark Brown , alsa-devel@alsa-project.org Subject: Re: [PATCH v1 7/8] ASoC: Intel: Switch DMI table match to a test of variable Message-ID: <20200120101714.GG32742@smile.fi.intel.com> References: <20200117175626.56358-1-andriy.shevchenko@linux.intel.com> <20200117175626.56358-7-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 01:10:55PM -0600, Pierre-Louis Bossart wrote: > On 1/17/20 11:56 AM, Andy Shevchenko wrote: > > Since we have a common x86 quirk that provides an exported variable, > > use it instead of local DMI table match. > > > > Cc: Cezary Rojewski > > Cc: Pierre-Louis Bossart > > Cc: Liam Girdwood > > Cc: Jie Yang > > Cc: Mark Brown > > Cc: alsa-devel@alsa-project.org > > Signed-off-by: Andy Shevchenko > > Thanks Andy. > > Acked-by: Pierre-Louis Bossart Thank you. Though I think I'll re-do this a bit, i.e. - convert the cht_quirk() to oneliner that is using ternary operator - convert also codec driver to use variable instead of DMI match > > > --- > > .../intel/common/soc-acpi-intel-cht-match.c | 28 ++----------------- > > 1 file changed, 3 insertions(+), 25 deletions(-) > > > > diff --git a/sound/soc/intel/common/soc-acpi-intel-cht-match.c b/sound/soc/intel/common/soc-acpi-intel-cht-match.c > > index d0fb43c2b9f6..833d2e130e6e 100644 > > --- a/sound/soc/intel/common/soc-acpi-intel-cht-match.c > > +++ b/sound/soc/intel/common/soc-acpi-intel-cht-match.c > > @@ -5,31 +5,11 @@ > > * Copyright (c) 2017, Intel Corporation. > > */ > > -#include > > +#include > > + > > #include > > #include > > -static unsigned long cht_machine_id; > > - > > -#define CHT_SURFACE_MACH 1 > > - > > -static int cht_surface_quirk_cb(const struct dmi_system_id *id) > > -{ > > - cht_machine_id = CHT_SURFACE_MACH; > > - return 1; > > -} > > - > > -static const struct dmi_system_id cht_table[] = { > > - { > > - .callback = cht_surface_quirk_cb, > > - .matches = { > > - DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), > > - DMI_MATCH(DMI_PRODUCT_NAME, "Surface 3"), > > - }, > > - }, > > - { } > > -}; > > - > > static struct snd_soc_acpi_mach cht_surface_mach = { > > .id = "10EC5640", > > .drv_name = "cht-bsw-rt5645", > > @@ -43,9 +23,7 @@ static struct snd_soc_acpi_mach *cht_quirk(void *arg) > > { > > struct snd_soc_acpi_mach *mach = arg; > > - dmi_check_system(cht_table); > > - > > - if (cht_machine_id == CHT_SURFACE_MACH) > > + if (x86_microsoft_surface_3_machine) > > return &cht_surface_mach; > > else > > return mach; > > -- With Best Regards, Andy Shevchenko