From patchwork Sun Oct 18 13:39:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 7430261 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21F749F1B9 for ; Sun, 18 Oct 2015 13:57:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B7FB206B1 for ; Sun, 18 Oct 2015 13:57:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 01F1F206A3 for ; Sun, 18 Oct 2015 13:57:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 217B926681E; Sun, 18 Oct 2015 15:57:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BDB1F26581D; Sun, 18 Oct 2015 15:44:26 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B8F5A26511F; Sun, 18 Oct 2015 15:44:25 +0200 (CEST) Received: from smtp-out-200.synserver.de (smtp-out-225.synserver.de [212.40.185.225]) by alsa0.perex.cz (Postfix) with ESMTP id 36A6D265112 for ; Sun, 18 Oct 2015 15:40:10 +0200 (CEST) Received: (qmail 28742 invoked by uid 0); 18 Oct 2015 13:40:09 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 27652 Received: from ppp-46-244-254-211.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [46.244.254.211] by 217.119.54.81 with SMTP; 18 Oct 2015 13:40:09 -0000 From: Lars-Peter Clausen To: Takashi Iwai , Jaroslav Kysela , Mark Brown , Liam Girdwood Date: Sun, 18 Oct 2015 15:39:31 +0200 Message-Id: <1445175573-11784-17-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1445175573-11784-1-git-send-email-lars@metafoo.de> References: <1445175573-11784-1-git-send-email-lars@metafoo.de> Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Vinod Koul , Mengdong Lin , Peter Ujfalusi , Yang A Fang , Jarkko Nikula Subject: [alsa-devel] [PATCH 16/18] ASoC: cht_bsw_max98090: Use snd_pcm_hw_constraint_single() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Use the new snd_pcm_hw_constraint_single() helper function rather than installing a list constraint with a single value. Since snd_pcm_hw_constraint_single() sets a static constraint while snd_pcm_hw_constraint_list() sets a dynamic constraint the former is slightly more efficient and it also needs less code. Signed-off-by: Lars-Peter Clausen --- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c index 49f4869..4e2fcf1 100644 --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c @@ -193,20 +193,10 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } -static unsigned int rates_48000[] = { - 48000, -}; - -static struct snd_pcm_hw_constraint_list constraints_48000 = { - .count = ARRAY_SIZE(rates_48000), - .list = rates_48000, -}; - static int cht_aif1_startup(struct snd_pcm_substream *substream) { - return snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, - &constraints_48000); + return snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_RATE, 48000); } static int cht_max98090_headset_init(struct snd_soc_component *component)