diff options
author | Xiubo Li <Li.Xiubo@freescale.com> | 2013-12-17 02:16:40 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-17 06:17:56 -0500 |
commit | 2b67f8ba41ac7acf01c8d5c742c713ead8b589cd (patch) | |
tree | 4269cbf8661a95b669ec0086253f949ac4108e28 | |
parent | e9036c2a60f368b8ddc349fbbcde918ed32ab597 (diff) |
ASoC: dmaengine: Add config parameter NULL check.
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/soc-generic-dmaengine-pcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 7483922f6ee3..2a6c569d991f 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, | |||
299 | !dev->of_node) | 299 | !dev->of_node) |
300 | return 0; | 300 | return 0; |
301 | 301 | ||
302 | if (config->dma_dev) { | 302 | if (config && config->dma_dev) { |
303 | /* | 303 | /* |
304 | * If this warning is seen, it probably means that your Linux | 304 | * If this warning is seen, it probably means that your Linux |
305 | * device structure does not match your HW device structure. | 305 | * device structure does not match your HW device structure. |
@@ -317,7 +317,7 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm, | |||
317 | name = "rx-tx"; | 317 | name = "rx-tx"; |
318 | else | 318 | else |
319 | name = dmaengine_pcm_dma_channel_names[i]; | 319 | name = dmaengine_pcm_dma_channel_names[i]; |
320 | if (config->chan_names[i]) | 320 | if (config && config->chan_names[i]) |
321 | name = config->chan_names[i]; | 321 | name = config->chan_names[i]; |
322 | chan = dma_request_slave_channel_reason(dev, name); | 322 | chan = dma_request_slave_channel_reason(dev, name); |
323 | if (IS_ERR(chan)) { | 323 | if (IS_ERR(chan)) { |