From patchwork Sun Oct 18 13:39:25 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: 7430171 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A4FBBEEA4 for ; Sun, 18 Oct 2015 13:50:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C08FF206A7 for ; Sun, 18 Oct 2015 13:50:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 018B420524 for ; Sun, 18 Oct 2015 13:50:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C8F842651F0; Sun, 18 Oct 2015 15:50:23 +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 E830D265528; Sun, 18 Oct 2015 15:42:36 +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 AC7C3265522; Sun, 18 Oct 2015 15:42:35 +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 D4023265054 for ; Sun, 18 Oct 2015 15:39:58 +0200 (CEST) Received: (qmail 28220 invoked by uid 0); 18 Oct 2015 13:39:58 -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:39:57 -0000 From: Lars-Peter Clausen To: Takashi Iwai , Jaroslav Kysela , Mark Brown , Liam Girdwood Date: Sun, 18 Oct 2015 15:39:25 +0200 Message-Id: <1445175573-11784-11-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 10/18] ASoC: wl1273: 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 instead of calling snd_pcm_hw_constraint_minmax() with the same value for min and max to install a constraint that limits the possible configuration values to a single value. Using snd_pcm_hw_constraint_single() makes the indented result clearer. Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/wl1273.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index 80fb1dc..7693c11 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -307,11 +307,10 @@ static int wl1273_startup(struct snd_pcm_substream *substream, switch (wl1273->mode) { case WL1273_MODE_BT: - snd_pcm_hw_constraint_minmax(substream->runtime, - SNDRV_PCM_HW_PARAM_RATE, - 8000, 8000); - snd_pcm_hw_constraint_minmax(substream->runtime, - SNDRV_PCM_HW_PARAM_CHANNELS, 1, 1); + snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_RATE, 8000); + snd_pcm_hw_constraint_single(substream->runtime, + SNDRV_PCM_HW_PARAM_CHANNELS, 1); break; case WL1273_MODE_FM_RX: if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {