From patchwork Wed Dec 11 04:32:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11284255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01D30138D for ; Wed, 11 Dec 2019 04:33:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BF9820652 for ; Wed, 11 Dec 2019 04:33:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="W1mFoB6f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BF9820652 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BB3C51669; Wed, 11 Dec 2019 05:32:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB3C51669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576038818; bh=bST8owQWQEowEpotxB7VQzPVxr4OVsipUxdof/AComA=; h=Date:From:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=W1mFoB6fxOjdhyVuBEfXdtTo45EQ8yuxjui3r8C1eNI+Xys3cqyvHxIIYDvFP536k Vf3Pczga0/SsY0mHoi9BrrpNWFBt1UKW5T4h1hdtoYPqWvg80Zhl4jfzsLW5LcY+Cu UYE7/FrRDHIh43nJL1DrM0ktz09sV0WiWdQPfyTI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AF069F80245; Wed, 11 Dec 2019 05:32:14 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 387F3F800EC; Wed, 11 Dec 2019 05:32:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: ** X-Spam-Status: No, score=2.7 required=5.0 tests=AC_FROM_MANY_DOTS, SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 1D80AF80234 for ; Wed, 11 Dec 2019 05:32:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1D80AF80234 Date: 11 Dec 2019 13:32:05 +0900 X-IronPort-AV: E=Sophos;i="5.69,301,1571670000"; d="scan'208";a="33854869" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 11 Dec 2019 13:32:05 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 9E703400A88C; Wed, 11 Dec 2019 13:32:05 +0900 (JST) Message-ID: <87eexbbhyy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH] ASoC: soc-core: tidyup for CONFIG_DMI X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto soc-core.c has 2 #ifdef CONFIG_DMI, but we can merge these. OTOH, soc.h has dmi_longname, but it is needed if CONFIG_DMI was defined. In other words, It is not needed if CONFIG_DMI was not defined. This patch tidyup these. Signed-off-by: Kuninori Morimoto --- include/sound/soc.h | 2 ++ sound/soc/soc-core.c | 32 +++++++++++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index c920f17..a6a3a7d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -986,7 +986,9 @@ struct snd_soc_card { const char *long_name; const char *driver_name; const char *components; +#ifdef CONFIG_DMI char dmi_longname[80]; +#endif /* CONFIG_DMI */ char topology_shortname[32]; struct device *dev; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f8090bd..51a404f 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -73,23 +73,6 @@ static int pmdown_time = 5000; module_param(pmdown_time, int, 0); MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)"); -#ifdef CONFIG_DMI -/* - * If a DMI filed contain strings in this blacklist (e.g. - * "Type2 - Board Manufacturer" or "Type1 - TBD by OEM"), it will be taken - * as invalid and dropped when setting the card long name from DMI info. - */ -static const char * const dmi_blacklist[] = { - "To be filled by OEM", - "TBD by OEM", - "Default String", - "Board Manufacturer", - "Board Vendor Name", - "Board Product Name", - NULL, /* terminator */ -}; -#endif - static ssize_t pmdown_time_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1608,6 +1591,21 @@ EXPORT_SYMBOL_GPL(snd_soc_runtime_set_dai_fmt); #ifdef CONFIG_DMI /* + * If a DMI filed contain strings in this blacklist (e.g. + * "Type2 - Board Manufacturer" or "Type1 - TBD by OEM"), it will be taken + * as invalid and dropped when setting the card long name from DMI info. + */ +static const char * const dmi_blacklist[] = { + "To be filled by OEM", + "TBD by OEM", + "Default String", + "Board Manufacturer", + "Board Vendor Name", + "Board Product Name", + NULL, /* terminator */ +}; + +/* * Trim special characters, and replace '-' with '_' since '-' is used to * separate different DMI fields in the card long name. Only number and * alphabet characters and a few separator characters are kept.