Hi Kai Thank you for your help > > But, unfortunately I don't want spaghetti error handling code again. > > I think we can solve it if we can *count* open / module ? > > Can you please test this patch ? > > I tested and this version works as well, so: > Reviewed-by: Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx> > > ... but, but, I have some doubts about th "opened" tracking as a solution. > > A single counter will track the overall number of component-substream > combinations, but if we have bugs in calling code and e.g. same > component-substream is passed multiple times to open or close, the > the single counter will go out of sync. > > So if the primary problem is the messy rollback in case one open fails, > what if we do the rollback directly in soc_pcm_components_open() and do > not add any additional tracking..? > > Let me send a proposal patch for that. Hmm... It seems the patch was not so good cleanup... Thank you for your proposal patch. I checked it. But, if it rollback when error with *last, my opinion is original code (= soc_pcm_components_close() needs *last parameter) (= same as just revert the patch) is better. Thank you for your help !! Best regards --- Kuninori Morimoto