ALSA: firewire: Replace runtime->status->state reference to runtime->state
authorTakashi Iwai <tiwai@suse.de>
Mon, 26 Sep 2022 13:55:51 +0000 (15:55 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 27 Sep 2022 06:47:25 +0000 (08:47 +0200)
The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob_pcm.c
sound/firewire/dice/dice-pcm.c
sound/firewire/digi00x/digi00x-pcm.c
sound/firewire/fireface/ff-pcm.c
sound/firewire/fireworks/fireworks_pcm.c
sound/firewire/motu/motu-pcm.c
sound/firewire/oxfw/oxfw-pcm.c
sound/firewire/tascam/tascam-pcm.c

index f8d9a20..ce49eef 100644 (file)
@@ -214,7 +214,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_bebob *bebob = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -236,7 +236,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&bebob->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                bebob->substreams_counter--;
 
        snd_bebob_stream_stop_duplex(bebob);
index a69ca11..d643662 100644 (file)
@@ -266,7 +266,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_dice *dice = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int events_per_period = params_period_size(hw_params);
                unsigned int events_per_buffer = params_buffer_size(hw_params);
@@ -293,7 +293,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&dice->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --dice->substreams_counter;
 
        snd_dice_stream_stop_duplex(dice);
index b7f6eda..3bd1575 100644 (file)
@@ -190,7 +190,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_dg00x *dg00x = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -212,7 +212,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&dg00x->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --dg00x->substreams_counter;
 
        snd_dg00x_stream_stop_duplex(dg00x);
index f978cc2..ec91567 100644 (file)
@@ -230,7 +230,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_ff *ff = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -252,7 +252,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&ff->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --ff->substreams_counter;
 
        snd_ff_stream_stop_duplex(ff);
index a0d5db1..c3c2186 100644 (file)
@@ -250,7 +250,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_efw *efw = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -272,7 +272,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&efw->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --efw->substreams_counter;
 
        snd_efw_stream_stop_duplex(efw);
index 8e14373..d410c2e 100644 (file)
@@ -210,7 +210,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_motu *motu = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -232,7 +232,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&motu->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --motu->substreams_counter;
 
        snd_motu_stream_stop_duplex(motu);
index 2dfa7e1..5f43a0b 100644 (file)
@@ -239,7 +239,7 @@ static int pcm_capture_hw_params(struct snd_pcm_substream *substream,
        struct snd_oxfw *oxfw = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int channels = params_channels(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
@@ -262,7 +262,7 @@ static int pcm_playback_hw_params(struct snd_pcm_substream *substream,
        struct snd_oxfw *oxfw = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int channels = params_channels(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
@@ -286,7 +286,7 @@ static int pcm_capture_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&oxfw->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --oxfw->substreams_count;
 
        snd_oxfw_stream_stop_duplex(oxfw);
@@ -301,7 +301,7 @@ static int pcm_playback_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&oxfw->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --oxfw->substreams_count;
 
        snd_oxfw_stream_stop_duplex(oxfw);
index 36c1353..f6da571 100644 (file)
@@ -119,7 +119,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
        struct snd_tscm *tscm = substream->private_data;
        int err = 0;
 
-       if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
+       if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
                unsigned int rate = params_rate(hw_params);
                unsigned int frames_per_period = params_period_size(hw_params);
                unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -141,7 +141,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
 
        mutex_lock(&tscm->mutex);
 
-       if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
+       if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
                --tscm->substreams_counter;
 
        snd_tscm_stream_stop_duplex(tscm);