[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200212101233.GA2618@vkoul-mobl>
Date: Wed, 12 Feb 2020 15:42:33 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
tiwai@...e.de, broonie@...nel.org, gregkh@...uxfoundation.org,
jank@...ence.com, srinivas.kandagatla@...aro.org,
slawomir.blauciak@...el.com,
Bard liao <yung-chuan.liao@...ux.intel.com>,
Rander Wang <rander.wang@...ux.intel.com>,
Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>
Subject: Re: [PATCH v2 4/5] soundwire: intel: add sdw_stream_setup helper for
.startup callback
On 14-01-20, 17:42, Pierre-Louis Bossart wrote:
> From: Rander Wang <rander.wang@...ux.intel.com>
>
> The sdw stream is allocated and stored in dai to share the sdw runtime
> information.
>
> Signed-off-by: Rander Wang <rander.wang@...ux.intel.com>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> ---
> drivers/soundwire/intel.c | 64 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
> index 999aa2cd9fea..c498812522ab 100644
> --- a/drivers/soundwire/intel.c
> +++ b/drivers/soundwire/intel.c
> @@ -617,6 +617,68 @@ static int intel_post_bank_switch(struct sdw_bus *bus)
> * DAI routines
> */
>
> +static int sdw_stream_setup(struct snd_pcm_substream *substream,
> + struct snd_soc_dai *dai)
> +{
> + struct snd_soc_pcm_runtime *rtd = substream->private_data;
> + struct sdw_stream_runtime *sdw_stream = NULL;
> + char *name;
> + int i, ret;
> +
> + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
> + name = kasprintf(GFP_KERNEL, "%s-Playback", dai->name);
> + else
> + name = kasprintf(GFP_KERNEL, "%s-Capture", dai->name);
I don't see name being feed on success. It is nicely freed on error but on
success it should be freed when you close
--
~Vinod
Powered by blists - more mailing lists