From patchwork Sun Oct 18 13:39:24 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: 7430121 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 A22F0BEEA4 for ; Sun, 18 Oct 2015 13:46:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD6F9206AC for ; Sun, 18 Oct 2015 13:46:34 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A053D20524 for ; Sun, 18 Oct 2015 13:46:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 89DB8265840; Sun, 18 Oct 2015 15:46:32 +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 9407A265307; Sun, 18 Oct 2015 15:41:33 +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 511B92652E9; Sun, 18 Oct 2015 15:41:32 +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 56E23264F32 for ; Sun, 18 Oct 2015 15:39:57 +0200 (CEST) Received: (qmail 28179 invoked by uid 0); 18 Oct 2015 13:39:56 -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:54 -0000 From: Lars-Peter Clausen To: Takashi Iwai , Jaroslav Kysela , Mark Brown , Liam Girdwood Date: Sun, 18 Oct 2015 15:39:24 +0200 Message-Id: <1445175573-11784-10-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 09/18] ASoC: uda134x: 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 and is slightly shorter. Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/uda134x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index e190263..e4c694c 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -150,14 +150,12 @@ static int uda134x_startup(struct snd_pcm_substream *substream, master_runtime->sample_bits, master_runtime->rate); - snd_pcm_hw_constraint_minmax(substream->runtime, + snd_pcm_hw_constraint_single(substream->runtime, SNDRV_PCM_HW_PARAM_RATE, - master_runtime->rate, master_runtime->rate); - snd_pcm_hw_constraint_minmax(substream->runtime, + snd_pcm_hw_constraint_single(substream->runtime, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, - master_runtime->sample_bits, master_runtime->sample_bits); uda134x->slave_substream = substream;