754 if (res < 0)
755 return res;
756 res = ops->do_action(substream, state);
757 if (res == 0)
758 ops->post_action(substream, state);
759 else if (ops->undo_action)
760 ops->undo_action(substream, state);
761 return res;
762}
763
764
765
766
767static int snd_pcm_action(struct action_ops *ops,
768 struct snd_pcm_substream *substream,
769 int state)
770{
771 int res;
772
773 if (snd_pcm_stream_linked(substream)) {
774 if (!spin_trylock(&substream->group->lock)) {
775 spin_unlock(&substream->self_group.lock);
776 spin_lock(&substream->group->lock);
777 spin_lock(&substream->self_group.lock);
778 }
779 res = snd_pcm_action_group(ops, substream, state, 1);
780 spin_unlock(&substream->group->lock);
781 } else {
782 res = snd_pcm_action_single(ops, substream, state);
783 }
784 return res;
785}
786
787
788
789
790static int snd_pcm_action_lock_irq(struct action_ops *ops,
791 struct snd_pcm_substream *substream,
792 int state)
793{
794 int res;