From patchwork Tue Apr 30 14:02:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13649216 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D318FC4345F for ; Tue, 30 Apr 2024 14:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9aecODoMkNvEZqr8NfSiu72PP4HMLD5Fr+O6tvGdyig=; b=k69yUrRF2Tulhl La/kA4iwPllocs9mhb7jJpcE8GAw1SKovok4NfXiLIk4M0LY41sPzsZqjKTlbCwnvMKUKSGiY+lvY W2TQnM3VNNjB5nkslC3XIzj/owLa2xFsYRawLk3+6dxhupOvVhUgSKXDv1H2Smb9aVv1aTvdGIIj/ 5PfkU3NiKP1WTlFJHPQIevHTG9IB+g/jt8PrPvt6r/Hd4iU+rvH9ApUcnn8GI1HE5wBAU+14O/xjx 73Qkj+neyDpDj01bFpiuVB8rF9/3/+ikQLPq9wxcvnQpnMaRLCttSYE6vYx8popfAoNbwm5ZWn7YG k3ddMh7aNkuoOL/2GTsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1o5d-00000006fBu-2cgx; Tue, 30 Apr 2024 14:04:13 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1o4k-00000006eX8-3H3w for linux-amlogic@bombadil.infradead.org; Tue, 30 Apr 2024 14:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Cc:To:In-Reply-To:References:Message-Id :Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender :Reply-To:Content-ID:Content-Description; bh=HMdvqht5zOkDrEgl++6w26ILXUpiKeLdEJgBolPMUp4=; b=kPMS68up+s8p5hRfDg6Ays54hx ACxhJ/ncLW1QbvOowjigjz5rqSeUYAz9oRCQiyyMpnh22Padd95S57dTg9U1f4lv8BfDs7o5fyx3L K09on4f+9G9+LfTxg2Xcc1wxefZV5BzfZtbCwCp8vCFqCzoMa+k51N5srMAHdGKCUiASSTyQceyMY 9odcCKSSN0NlvJA48lf4GBwLt+KpRVKJrL7c18IuExMzIWOkHTIoLnU3fynNT7IwemTfPV3wOLAoD EvzKrfc4UlOvXE/BPQWhJ5yhs4ojIZ3gKzw9XRAwvGKkwBBjqyBgpFSrtpRXHDGtZblpcFwnbbtcj t75UaKEw==; Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1o4e-0000000EvnP-1gsH for linux-amlogic@lists.infradead.org; Tue, 30 Apr 2024 14:03:17 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-51abd9fcbf6so9618721e87.1 for ; Tue, 30 Apr 2024 07:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714485790; x=1715090590; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HMdvqht5zOkDrEgl++6w26ILXUpiKeLdEJgBolPMUp4=; b=tljn1AYRjS+IzmGOu3ftIMf8veANpAlh6TZtqYwfzfG5yimlk3OvxyJnUKTcg8r+71 ypVzUT8FY/i4rmzq2Xzog2LYdleF+vLvOY7A3llrqe7xb7lz5UW+wIYomXLmynChD7Mz QjJt67Ay7bSGi9aaFKTICmUy3rLGTYk9DBT38RV1cFq9QZNPnpxV0i6br1afi7JfcW0K WzQiwuSTaxG9J6JLIxRHXgqgQgt9fFIcpjwsBD4wK6nZkWrJKctsWdoiTWHiC29kdCmx 5sPdvhq2T8TWCNUOiCqTOA9EqMGr5mj9534bFl87mneF88YWotdgsOZvqQWMAsY5N/h6 BsMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714485790; x=1715090590; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HMdvqht5zOkDrEgl++6w26ILXUpiKeLdEJgBolPMUp4=; b=iUYsM95fUQLTLl2P4rtqJrjmBwiJaa2/+OdgzZ0PVROzJOjoDLbW9HECNelp3p1/Eq +qsYousFgM0tfhTiJLVETN3ha8VKfnTSYZWOrg6peIsgAhInrcZmqeiAYgYSmjaVkOUB 3W3p/K7OUwcgeIWopD8c9w8tKF54YVsYPakhvFhp27s/bOp1dnP7azTzwDbTWHTEeP27 CGMXlonaUa3T4PFfCUqUPmeQz5lT5nISYmFR9Sxh3OUoarAwvkGAgsRDvyRNMtW7kucL DBM2NcGwn+EQWSLam42Bstb3Z68hvQ9XqiMNFxDzjzS40jIjswfjsZ8YHmK2/hpnKDhB srOA== X-Forwarded-Encrypted: i=1; AJvYcCU6Bj7D6HUlrIgdwpvpBjVn5xyt7obZLwlhsSgiqUg1tqeNqmwMl2PIpr4htoNv9S3M67wxWcoLGVujMaTn8wo5wuRer+5HbRXNxviwGiqdh7o= X-Gm-Message-State: AOJu0YxlfWATEQOCKN3sB0/tBtbGQJubQXucHMQxhXWxn+2JsoROliAG 71b+vL1D5dhA4R8wkHZ6X+5Qu8Q/ShY6K93puEdGOGgWhCHQZ3KJgBzqe7FTQYw= X-Google-Smtp-Source: AGHT+IHF9BCm3Hpto4qRWqGnR6LWsHIvsR6psO89D0oVIbNwL85POL6TwPmXMEZNmxvO3lf19inFfA== X-Received: by 2002:a05:6512:3982:b0:519:166a:d217 with SMTP id j2-20020a056512398200b00519166ad217mr13782162lfu.32.1714485789720; Tue, 30 Apr 2024 07:03:09 -0700 (PDT) Received: from [127.0.1.1] ([178.197.223.16]) by smtp.gmail.com with ESMTPSA id pv27-20020a170907209b00b00a5940af3f67sm31434ejb.16.2024.04.30.07.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:03:08 -0700 (PDT) From: Krzysztof Kozlowski Date: Tue, 30 Apr 2024 16:02:18 +0200 Subject: [PATCH 09/13] ASoC: loongson: Use snd_soc_substream_to_rtd() for accessing private_data MIME-Version: 1.0 Message-Id: <20240430-asoc-snd-substream-clean-v1-9-6f8a8902b479@linaro.org> References: <20240430-asoc-snd-substream-clean-v1-0-6f8a8902b479@linaro.org> In-Reply-To: <20240430-asoc-snd-substream-clean-v1-0-6f8a8902b479@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Thierry Reding , Jonathan Hunter , Peter Ujfalusi , Jarkko Nikula , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Matthias Brugger , AngeloGioacchino Del Regno , Jerome Brunet , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Sylwester Nawrocki , Ban Tao , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, imx@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1661; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=b6kuGLsh7Fncnab7O/x1sZHKoAE2to9yOPoWLkFWFoc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmMPn1MXBzjTFYW1vw+HGX+bgAlb8xjIeAN12qT 8heTgZA8qOJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZjD59QAKCRDBN2bmhouD 18asD/sG4cfwm5/cvMuyWs/KhNg7FPcNnM4eFOVtUPz5xnRqVF4pt6jUcKqDJjRfrq3s5JoYJ3c vBUD9jgSmkuB8tYCeWM/fFAOimxAXRa1keWd3xM/+KL3qsLAqkpXIdkHwS20hkhT7fIF+E2cU34 35Ajyyg+q/q32ZXoeF+z7chz0oMLOUq3jDN4mGTO2PE/l4xWHZqC30HaBVtVZLYOr2WdfJN14l+ YsJUUR1UBA5aXsr++f01Vf/m5pPIFSvYtRQcrp5YyZeaWVGm24AD0kDXcfdaYuSD6hlnoVB1j9K LlP/ODUgDC6zWb68dtVEkLXAfru4YUdiN9M9PLsBzBz0IIoe1aPihWRNB80Uyu2Z/lWy8ceeaX/ rMUdGMoXE+1AcbqrE0sZvujjGVmL/5axnumRcAJRvAi4jE27qyDapAyfgL2FTvrC5fHHC0WF/Pe zkWTZpTx4al2ZotNljcAD9imjfQSGKB+Iovem2sQW+eZIGnWm6EeDiADskK/J5bROpHvWbfLRMM rXaqxY9WzOy+EFocuuu+Vq9ckAOOUcikB/3Y6YS/odwg7AZZA9hLSefMdTXWrnaJnScqKcP/bAw gRWnITyzDhtzuAN/vsyQ5gi3lbBmCYNL5XhK6oDlLe5BamoqScRwdbTHBthRDUiaLtaYXHQGkXj jOwKVSiBpozJEaw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_150312_535157_E14A4D2C X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Do not open-code snd_soc_substream_to_rtd(). Signed-off-by: Krzysztof Kozlowski --- sound/soc/loongson/loongson_card.c | 2 +- sound/soc/loongson/loongson_dma.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c index e8432d466f60..fae5e9312bf0 100644 --- a/sound/soc/loongson/loongson_card.c +++ b/sound/soc/loongson/loongson_card.c @@ -23,7 +23,7 @@ struct loongson_card_data { static int loongson_card_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); struct loongson_card_data *ls_card = snd_soc_card_get_drvdata(rtd->card); diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c index 8090662e8ff2..4fcc2868160b 100644 --- a/sound/soc/loongson/loongson_dma.c +++ b/sound/soc/loongson/loongson_dma.c @@ -226,7 +226,7 @@ static int loongson_pcm_open(struct snd_soc_component *component, struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; - struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_card *card = substream->pcm->card; struct loongson_runtime_data *prtd; struct loongson_dma_data *dma_data;