diff options
-rw-r--r-- | sound/soc/soc-compress.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index da83e5658f62..3853f7eb3f28 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -384,7 +384,14 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) | |||
384 | /* check client and interface hw capabilities */ | 384 | /* check client and interface hw capabilities */ |
385 | snprintf(new_name, sizeof(new_name), "%s %s-%d", | 385 | snprintf(new_name, sizeof(new_name), "%s %s-%d", |
386 | rtd->dai_link->stream_name, codec_dai->name, num); | 386 | rtd->dai_link->stream_name, codec_dai->name, num); |
387 | direction = SND_COMPRESS_PLAYBACK; | 387 | |
388 | if (codec_dai->driver->playback.channels_min) | ||
389 | direction = SND_COMPRESS_PLAYBACK; | ||
390 | else if (codec_dai->driver->capture.channels_min) | ||
391 | direction = SND_COMPRESS_CAPTURE; | ||
392 | else | ||
393 | return -EINVAL; | ||
394 | |||
388 | compr = kzalloc(sizeof(*compr), GFP_KERNEL); | 395 | compr = kzalloc(sizeof(*compr), GFP_KERNEL); |
389 | if (compr == NULL) { | 396 | if (compr == NULL) { |
390 | snd_printk(KERN_ERR "Cannot allocate compr\n"); | 397 | snd_printk(KERN_ERR "Cannot allocate compr\n"); |