diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ac97-pcm.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97-pcm.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c index 56815c1d47b3..d7dc9bde0976 100644 --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c | |||
@@ -421,7 +421,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); | |||
421 | static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) | 421 | static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) |
422 | { | 422 | { |
423 | struct snd_card *card = rtd->card->snd_card; | 423 | struct snd_card *card = rtd->card->snd_card; |
424 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
425 | struct snd_pcm *pcm = rtd->pcm; | 424 | struct snd_pcm *pcm = rtd->pcm; |
426 | int ret = 0; | 425 | int ret = 0; |
427 | 426 | ||
@@ -431,14 +430,14 @@ static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd) | |||
431 | if (!card->dev->coherent_dma_mask) | 430 | if (!card->dev->coherent_dma_mask) |
432 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 431 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
433 | 432 | ||
434 | if (dai->driver->playback.channels_min) { | 433 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
435 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 434 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
436 | SNDRV_PCM_STREAM_PLAYBACK); | 435 | SNDRV_PCM_STREAM_PLAYBACK); |
437 | if (ret) | 436 | if (ret) |
438 | goto out; | 437 | goto out; |
439 | } | 438 | } |
440 | 439 | ||
441 | if (dai->driver->capture.channels_min) { | 440 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
442 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 441 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
443 | SNDRV_PCM_STREAM_CAPTURE); | 442 | SNDRV_PCM_STREAM_CAPTURE); |
444 | if (ret) | 443 | if (ret) |
@@ -475,17 +474,7 @@ static struct platform_driver bf5xx_pcm_driver = { | |||
475 | .remove = __devexit_p(bf5xx_soc_platform_remove), | 474 | .remove = __devexit_p(bf5xx_soc_platform_remove), |
476 | }; | 475 | }; |
477 | 476 | ||
478 | static int __init snd_bf5xx_pcm_init(void) | 477 | module_platform_driver(bf5xx_pcm_driver); |
479 | { | ||
480 | return platform_driver_register(&bf5xx_pcm_driver); | ||
481 | } | ||
482 | module_init(snd_bf5xx_pcm_init); | ||
483 | |||
484 | static void __exit snd_bf5xx_pcm_exit(void) | ||
485 | { | ||
486 | platform_driver_unregister(&bf5xx_pcm_driver); | ||
487 | } | ||
488 | module_exit(snd_bf5xx_pcm_exit); | ||
489 | 478 | ||
490 | MODULE_AUTHOR("Cliff Cai"); | 479 | MODULE_AUTHOR("Cliff Cai"); |
491 | MODULE_DESCRIPTION("ADI Blackfin AC97 PCM DMA module"); | 480 | MODULE_DESCRIPTION("ADI Blackfin AC97 PCM DMA module"); |