All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Xiubo Li <Li.Xiubo@freescale.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de,
	linux-kernel@vger.kernel.org, lgirdwood@gmail.com,
	broonie@kernel.org
Subject: Re: [PATCH] ASoC: dmaengine: Add config parameter NULL check.
Date: Tue, 17 Dec 2013 08:12:17 +0100	[thread overview]
Message-ID: <52AFF951.9020201@metafoo.de> (raw)
In-Reply-To: <1387264600-14225-1-git-send-email-Li.Xiubo@freescale.com>

On 12/17/2013 08:16 AM, Xiubo Li wrote:
> Because the "ASoC: dmaengine-pcm: Provide default config" has provided
> us one defualt config of DMA. When using this, the config parameter of
> devm_snd_dmaengine_pcm_register() will be NULL, so here we need to have
> a check before using it.
> 
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Thanks.

> ---
>  sound/soc/soc-generic-dmaengine-pcm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index 7483922..2a6c569 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -299,7 +299,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
>  	    !dev->of_node)
>  		return 0;
>  
> -	if (config->dma_dev) {
> +	if (config && config->dma_dev) {
>  		/*
>  		 * If this warning is seen, it probably means that your Linux
>  		 * device structure does not match your HW device structure.
> @@ -317,7 +317,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
>  			name = "rx-tx";
>  		else
>  			name = dmaengine_pcm_dma_channel_names[i];
> -		if (config->chan_names[i])
> +		if (config && config->chan_names[i])
>  			name = config->chan_names[i];
>  		chan = dma_request_slave_channel_reason(dev, name);
>  		if (IS_ERR(chan)) {
> 

WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars@metafoo.de>
To: Xiubo Li <Li.Xiubo@freescale.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.de, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] ASoC: dmaengine: Add config parameter NULL check.
Date: Tue, 17 Dec 2013 08:12:17 +0100	[thread overview]
Message-ID: <52AFF951.9020201@metafoo.de> (raw)
In-Reply-To: <1387264600-14225-1-git-send-email-Li.Xiubo@freescale.com>

On 12/17/2013 08:16 AM, Xiubo Li wrote:
> Because the "ASoC: dmaengine-pcm: Provide default config" has provided
> us one defualt config of DMA. When using this, the config parameter of
> devm_snd_dmaengine_pcm_register() will be NULL, so here we need to have
> a check before using it.
> 
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Thanks.

> ---
>  sound/soc/soc-generic-dmaengine-pcm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index 7483922..2a6c569 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -299,7 +299,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
>  	    !dev->of_node)
>  		return 0;
>  
> -	if (config->dma_dev) {
> +	if (config && config->dma_dev) {
>  		/*
>  		 * If this warning is seen, it probably means that your Linux
>  		 * device structure does not match your HW device structure.
> @@ -317,7 +317,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm,
>  			name = "rx-tx";
>  		else
>  			name = dmaengine_pcm_dma_channel_names[i];
> -		if (config->chan_names[i])
> +		if (config && config->chan_names[i])
>  			name = config->chan_names[i];
>  		chan = dma_request_slave_channel_reason(dev, name);
>  		if (IS_ERR(chan)) {
> 


  reply	other threads:[~2013-12-17  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  7:16 [PATCH] ASoC: dmaengine: Add config parameter NULL check Xiubo Li
2013-12-17  7:16 ` Xiubo Li
2013-12-17  7:12 ` Lars-Peter Clausen [this message]
2013-12-17  7:12   ` [alsa-devel] " Lars-Peter Clausen
2013-12-17 11:18 ` Mark Brown
2013-12-17 11:18   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52AFF951.9020201@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.