diff options
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 6ede7dc6c10a..a59bd352d342 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -378,7 +378,6 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm) | |||
378 | static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) | 378 | static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) |
379 | { | 379 | { |
380 | struct snd_card *card = rtd->card->snd_card; | 380 | struct snd_card *card = rtd->card->snd_card; |
381 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
382 | struct snd_pcm *pcm = rtd->pcm; | 381 | struct snd_pcm *pcm = rtd->pcm; |
383 | int ret = 0; | 382 | int ret = 0; |
384 | 383 | ||
@@ -387,14 +386,14 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) | |||
387 | if (!card->dev->coherent_dma_mask) | 386 | if (!card->dev->coherent_dma_mask) |
388 | card->dev->coherent_dma_mask = DMA_BIT_MASK(64); | 387 | card->dev->coherent_dma_mask = DMA_BIT_MASK(64); |
389 | 388 | ||
390 | if (dai->driver->playback.channels_min) { | 389 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
391 | ret = omap_pcm_preallocate_dma_buffer(pcm, | 390 | ret = omap_pcm_preallocate_dma_buffer(pcm, |
392 | SNDRV_PCM_STREAM_PLAYBACK); | 391 | SNDRV_PCM_STREAM_PLAYBACK); |
393 | if (ret) | 392 | if (ret) |
394 | goto out; | 393 | goto out; |
395 | } | 394 | } |
396 | 395 | ||
397 | if (dai->driver->capture.channels_min) { | 396 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
398 | ret = omap_pcm_preallocate_dma_buffer(pcm, | 397 | ret = omap_pcm_preallocate_dma_buffer(pcm, |
399 | SNDRV_PCM_STREAM_CAPTURE); | 398 | SNDRV_PCM_STREAM_CAPTURE); |
400 | if (ret) | 399 | if (ret) |
@@ -433,17 +432,7 @@ static struct platform_driver omap_pcm_driver = { | |||
433 | .remove = __devexit_p(omap_pcm_remove), | 432 | .remove = __devexit_p(omap_pcm_remove), |
434 | }; | 433 | }; |
435 | 434 | ||
436 | static int __init snd_omap_pcm_init(void) | 435 | module_platform_driver(omap_pcm_driver); |
437 | { | ||
438 | return platform_driver_register(&omap_pcm_driver); | ||
439 | } | ||
440 | module_init(snd_omap_pcm_init); | ||
441 | |||
442 | static void __exit snd_omap_pcm_exit(void) | ||
443 | { | ||
444 | platform_driver_unregister(&omap_pcm_driver); | ||
445 | } | ||
446 | module_exit(snd_omap_pcm_exit); | ||
447 | 436 | ||
448 | MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@bitmer.com>"); | 437 | MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@bitmer.com>"); |
449 | MODULE_DESCRIPTION("OMAP PCM DMA module"); | 438 | MODULE_DESCRIPTION("OMAP PCM DMA module"); |