From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9DD5C433F5 for ; Tue, 16 Nov 2021 11:47:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87D1461A08 for ; Tue, 16 Nov 2021 11:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235554AbhKPLuC (ORCPT ); Tue, 16 Nov 2021 06:50:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231624AbhKPLth (ORCPT ); Tue, 16 Nov 2021 06:49:37 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2098EC061570 for ; Tue, 16 Nov 2021 03:46:40 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 133so16683928wme.0 for ; Tue, 16 Nov 2021 03:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vU5yaEpd/Y0DZa1Q/uJoC95gJS14ZCBm7xrXmd2b678=; b=q6wAjGaeA6r4rXyycstm1UqubMBDnj8KkmEe3inUHwr7tTisgEBUt4wXQAgESktp7h D2ayhCAY74WbLD+9BtrTnKNLwOxlPFGJW9p19LMaR+9oBoEmcWxswLwo9wdzBcu2U/XP M9BHY8eOjDy0kdd2cfO87vmHlyGdNIxLVaUl9H9+bkFfhBR40JieNFh+eDaj2jlOfMq1 7QAwTQd3gwD2QXxgOv8YgaL9bCHBEBcSAKkn3b0C8ijP1DYxyVSnLl9M0aeT/Jd9/xJl FjIitTuv8lsGPvh0+906Y23QM+O+LSzufDTZWFoVktxJgGjSBwmLrF4Pmp3UcBMQLBQ5 V1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vU5yaEpd/Y0DZa1Q/uJoC95gJS14ZCBm7xrXmd2b678=; b=Zaqmz02CvKpy92Jyl2hxwKYQRrC8X/FgVBFNUwDf0H0zAXm+ufKN6WcReKrWYDR580 MZjlzktj9Z4WjORRqvKWgGAGfxHB8aWIE0KFXw1+85BbmU5fhNg8ropu9JJgMWo534EQ 74KHVfcMVfqg1h9CW44qTFD6CfgXQe886DlrgDE1y/GFZuRuGMNn7KbDutDFuBXaYMWb RopWplEgW0KiXprbyff4KIRTj7t3gYHv1WA2vicwB2V8YxBojZB8XaghLhwDD4ElLGgq U+LtVlkEwEjK/W2eRyvYezTPdAS+64Au81MVZ99ggiAepoAoZoWW61blf6/Pva3TwXrh AwJw== X-Gm-Message-State: AOAM532YvmIfY7EhnnD+i22C9VJZL5dbF0binL7UIC7fZjJRf683/5IX NxnB/gNQJJjOvDOPGewS5endWQ== X-Google-Smtp-Source: ABdhPJwXjeDLbMbYVW6fYTxzvgg2sf1oxHDUYlwcNvj2ok4/I9+uItght9lMpiSzEu5pFYc3mBrOGw== X-Received: by 2002:a05:600c:1c13:: with SMTP id j19mr68615165wms.175.1637063198772; Tue, 16 Nov 2021 03:46:38 -0800 (PST) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id z11sm16934698wrt.58.2021.11.16.03.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 03:46:38 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 2/3] ASoC: codecs: wcd934x: return error code correctly from hw_params Date: Tue, 16 Nov 2021 11:46:22 +0000 Message-Id: <20211116114623.11891-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211116114623.11891-1-srinivas.kandagatla@linaro.org> References: <20211116114623.11891-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Error returned from wcd934x_slim_set_hw_params() are not passed to upper layer, this could be misleading to the user which can start sending stream leading to unnecessary errors. Fix this by properly returning the errors. Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/wcd934x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index c496b359f2f4..4f568abd59e2 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -1896,9 +1896,8 @@ static int wcd934x_hw_params(struct snd_pcm_substream *substream, } wcd->dai[dai->id].sconfig.rate = params_rate(params); - wcd934x_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream); - return 0; + return wcd934x_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream); } static int wcd934x_hw_free(struct snd_pcm_substream *substream, -- 2.21.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FFF8C433F5 for ; Tue, 16 Nov 2021 11:48:53 +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 423DA60C4A for ; Tue, 16 Nov 2021 11:48:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 423DA60C4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=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 95B8C1689; Tue, 16 Nov 2021 12:48:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 95B8C1689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1637063330; bh=AxORZepENFqLugX4B6hKOMeUK+eXYOrHGzIJf3oqFTs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PA0dXncBnB4x/oyWhBtLePHGD/qfLRlBpfyLGj/LODARSKTYGQ11FYaX3H2EUqojR YMShPPzzr0bovDN0Y8AgtXMdy5ac52n66VeRKZSSEo5Hxdk2I9YXkOZYrMsia6NLKM c4IXKUZrhfK/VMfHhse3s1PkOmPbFC74NE0g2TYQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 40B09F804ED; Tue, 16 Nov 2021 12:46:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4D087F804E7; Tue, 16 Nov 2021 12:46:49 +0100 (CET) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A0F65F800FA for ; Tue, 16 Nov 2021 12:46:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A0F65F800FA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q6wAjGae" Received: by mail-wm1-x329.google.com with SMTP id c71-20020a1c9a4a000000b0032cdcc8cbafso2148404wme.3 for ; Tue, 16 Nov 2021 03:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vU5yaEpd/Y0DZa1Q/uJoC95gJS14ZCBm7xrXmd2b678=; b=q6wAjGaeA6r4rXyycstm1UqubMBDnj8KkmEe3inUHwr7tTisgEBUt4wXQAgESktp7h D2ayhCAY74WbLD+9BtrTnKNLwOxlPFGJW9p19LMaR+9oBoEmcWxswLwo9wdzBcu2U/XP M9BHY8eOjDy0kdd2cfO87vmHlyGdNIxLVaUl9H9+bkFfhBR40JieNFh+eDaj2jlOfMq1 7QAwTQd3gwD2QXxgOv8YgaL9bCHBEBcSAKkn3b0C8ijP1DYxyVSnLl9M0aeT/Jd9/xJl FjIitTuv8lsGPvh0+906Y23QM+O+LSzufDTZWFoVktxJgGjSBwmLrF4Pmp3UcBMQLBQ5 V1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vU5yaEpd/Y0DZa1Q/uJoC95gJS14ZCBm7xrXmd2b678=; b=4LU7nYm1QyuPGibH03N97hS+dfSfkxavfHSDWtSit0TP10edSDEEqW5slfGsDqFtPZ 9yrfYzVukYtf4BevJvZ4AQTvD3GsWncVdDqx5CT/Easwmc2uZs11dCN9L7KOVVdSVeqv ycjCsxk5HgIrmHetT2xjpHYXaAp5OUva9SbYgVuu0oiYoM+AAxA7NHX9WG+opQr2n8GT BBgCwyblv7OyMzzHHP7sE+YGyzgQftV04rN+gFA2V/cAyXIqQMakMPmxeyOVyPDgDUdY 16Bmo0WvTnQczXlQF0BNnBYkqJhg/8SdyecWxEe2MEe3/9wFX/c6/BfNSFMW1jBKuRkw 2nCg== X-Gm-Message-State: AOAM5332qHWBmZuZUeDt2gBBo/olKZh8go2FXXTk0Wn9iwmLpdXFVK5h WO0XwWcDcuY/Z+dgNSOv5j6dnA== X-Google-Smtp-Source: ABdhPJwXjeDLbMbYVW6fYTxzvgg2sf1oxHDUYlwcNvj2ok4/I9+uItght9lMpiSzEu5pFYc3mBrOGw== X-Received: by 2002:a05:600c:1c13:: with SMTP id j19mr68615165wms.175.1637063198772; Tue, 16 Nov 2021 03:46:38 -0800 (PST) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id z11sm16934698wrt.58.2021.11.16.03.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 03:46:38 -0800 (PST) From: Srinivas Kandagatla To: broonie@kernel.org Subject: [PATCH 2/3] ASoC: codecs: wcd934x: return error code correctly from hw_params Date: Tue, 16 Nov 2021 11:46:22 +0000 Message-Id: <20211116114623.11891-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20211116114623.11891-1-srinivas.kandagatla@linaro.org> References: <20211116114623.11891-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, pierre-louis.bossart@linux.intel.com, tiwai@suse.com 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" Error returned from wcd934x_slim_set_hw_params() are not passed to upper layer, this could be misleading to the user which can start sending stream leading to unnecessary errors. Fix this by properly returning the errors. Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Signed-off-by: Srinivas Kandagatla --- sound/soc/codecs/wcd934x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index c496b359f2f4..4f568abd59e2 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -1896,9 +1896,8 @@ static int wcd934x_hw_params(struct snd_pcm_substream *substream, } wcd->dai[dai->id].sconfig.rate = params_rate(params); - wcd934x_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream); - return 0; + return wcd934x_slim_set_hw_params(wcd, &wcd->dai[dai->id], substream->stream); } static int wcd934x_hw_free(struct snd_pcm_substream *substream, -- 2.21.0