Re: [PATCH 16/20] ASoC: soc-dai.c: replace dpcm_playback/capture to playback/capture_only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amadeusz

> > -	dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK];
> > -	dai_link->dpcm_capture  = supported[SNDRV_PCM_STREAM_CAPTURE];
> > +	dai_link->playback_only = !supported[SNDRV_PCM_STREAM_CAPTURE];
> > +	dai_link->capture_only  = !supported[SNDRV_PCM_STREAM_PLAYBACK];
> >   }
> >   EXPORT_SYMBOL_GPL(snd_soc_dai_link_set_capabilities);
> >   
> 
> What happens if somehow both supported[SNDRV_PCM_STREAM_CAPTURE] and 
> supported[SNDRV_PCM_STREAM_PLAYBACK] are false, and so both 
> dai_link->playback_only & dai_link->capture_only get set to true?

I think it is original code issue (= both dpcm_playback/capture are false).
[01/20] patch will indicate error in such case.

> Perhaps assignment should be more like:
> dai_link->playback_only = supported[SNDRV_PCM_STREAM_PLAYBACK] && 
> !supported[SNDRV_PCM_STREAM_CAPTURE];
> dai_link->playback_only = supported[SNDRV_PCM_STREAM_CAPTURE] && 
> !supported[SNDRV_PCM_STREAM_PLAYBACK];

Yes, this is nice idea.
Will do in v2 patch


Thank you for your help !!

Best regards
---
Kuninori Morimoto



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux