+
+ if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ this_pid = korg1212->playback_pid;
+ other_pid = korg1212->capture_pid;
+ } else {
+ this_pid = korg1212->capture_pid;
+ other_pid = korg1212->playback_pid;
+ }
+
+ if ((other_pid > 0) && (this_pid != other_pid)) {
+
+ /* The other stream is open, and not by the same
+ task as this one. Make sure that the parameters
+ that matter are the same.
+ */
+
+ if ((int)params_rate(params) != korg1212->clkRate) {
+ spin_unlock_irqrestore(&korg1212->lock, flags);
+ _snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_RATE);
+ return -EBUSY;
+ }
+
+ spin_unlock_irqrestore(&korg1212->lock, flags);
+ return 0;
+ }
+