From patchwork Tue Aug 9 12:44:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9271329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9F3B460839 for ; Tue, 9 Aug 2016 14:15:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E3E02833B for ; Tue, 9 Aug 2016 14:15:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8072928375; Tue, 9 Aug 2016 14:15:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15AF72833B for ; Tue, 9 Aug 2016 14:15:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F09352683AD; Tue, 9 Aug 2016 16:15:24 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5943F266DDD; Tue, 9 Aug 2016 15:41:07 +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 57198266DBE; Tue, 9 Aug 2016 15:41:06 +0200 (CEST) Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id B69BD267CB5 for ; Tue, 9 Aug 2016 14:44:13 +0200 (CEST) Received: from debutante.sirena.org.uk ([2a01:348:6:8808:fab::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bX6O9-000507-EN; Tue, 09 Aug 2016 12:44:11 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1bX6O6-0003b8-Av; Tue, 09 Aug 2016 13:44:06 +0100 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87invl9gbq.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Tue, 09 Aug 2016 13:44:06 +0100 X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: alsa-devel@alsa-project.org, Banajit Goswami , Simon , Patrick Lai , Takashi Iwai , Liam Girdwood , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata()" to the asoc tree 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 The patch ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata() has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 6adcbdcd4b6e8301c3a4c61284e701f87de9a409 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 1 Aug 2016 06:10:54 +0000 Subject: [PATCH] ASoC: lpass-platform: don't use snd_soc_pcm_set_drvdata() snd_soc_pcm_set_drvdata() will set driver data to rtd->dev, but driver data of rtd->dev is already used as "rtd" on soc_post_component_init(). static int soc_post_component_init(xxx) { ... dev_set_drvdata(rtd->dev, rtd); ... } To remove confusion, snd_soc_pcm_set/get_drvdata() should be removed soon. This patch is for it. qcom/lpass-platform.c sets struct lpass_pcm_data to rtd->dev today, but we can replace it to struct lpass_data :: private_data. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/qcom/lpass-platform.c | 14 +++++++------- sound/soc/qcom/lpass.h | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index db000c6987a1..a144c14c7169 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -84,9 +84,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; - struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime); struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); + struct lpass_pcm_data *pcm_data = drvdata->private_data; struct lpass_variant *v = drvdata->variant; snd_pcm_format_t format = params_format(params); unsigned int channels = params_channels(params); @@ -177,9 +177,9 @@ static int lpass_platform_pcmops_hw_params(struct snd_pcm_substream *substream, static int lpass_platform_pcmops_hw_free(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; - struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime); struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); + struct lpass_pcm_data *pcm_data = drvdata->private_data; struct lpass_variant *v = drvdata->variant; unsigned int reg; int ret; @@ -201,9 +201,9 @@ static int lpass_platform_pcmops_prepare(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; - struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime); struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); + struct lpass_pcm_data *pcm_data = drvdata->private_data; struct lpass_variant *v = drvdata->variant; int ret, ch, dir = substream->stream; @@ -255,9 +255,9 @@ static int lpass_platform_pcmops_trigger(struct snd_pcm_substream *substream, int cmd) { struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; - struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime); struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); + struct lpass_pcm_data *pcm_data = drvdata->private_data; struct lpass_variant *v = drvdata->variant; int ret, ch, dir = substream->stream; @@ -331,9 +331,9 @@ static snd_pcm_uframes_t lpass_platform_pcmops_pointer( struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *soc_runtime = substream->private_data; - struct lpass_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(soc_runtime); struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); + struct lpass_pcm_data *pcm_data = drvdata->private_data; struct lpass_variant *v = drvdata->variant; unsigned int base_addr, curr_addr; int ret, ch, dir = substream->stream; @@ -483,7 +483,7 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime) return -ENOMEM; data->i2s_port = cpu_dai->driver->id; - snd_soc_pcm_set_drvdata(soc_runtime, data); + drvdata->private_data = data; psubstream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; if (psubstream) { @@ -570,8 +570,8 @@ static void lpass_platform_pcm_free(struct snd_pcm *pcm) substream = pcm->streams[i].substream; if (substream) { rt = substream->private_data; - data = snd_soc_pcm_get_drvdata(rt); drvdata = snd_soc_platform_get_drvdata(rt->platform); + data = drvdata->private_data; ch = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? data->rdma_ch diff --git a/sound/soc/qcom/lpass.h b/sound/soc/qcom/lpass.h index 30714ad1e138..35b3cea8207d 100644 --- a/sound/soc/qcom/lpass.h +++ b/sound/soc/qcom/lpass.h @@ -58,6 +58,8 @@ struct lpass_data { /* 8016 specific */ struct clk *pcnoc_mport_clk; struct clk *pcnoc_sway_clk; + + void *private_data; }; /* Vairant data per each SOC */