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 f8d9a2041264d9c102824218d02f139e45a65636..ce49eef0fcbaae7e39df210408c1215028bf0703 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 a69ca1111b0332f5386f154d6a2d4998d23c55b6..d64366217d572d78a3aea031432203609a589a1d 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 b7f6eda09f9f7a444530b190f273c02b05319ff3..3bd1575c9d9c1f9095308564fb72414abf03973c 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 f978cc2fed7dd5cec0fa99753f32a5f26d5fa794..ec915671a79b3f6db870254c86c4c182ce520473 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 a0d5db1d8eb2371f211b6b506648a5eab4936575..c3c21860b245bcc9d78f6b1daa021ba96de8fca4 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 8e143737126388079baec57a3faca94c5df69ecf..d410c2efbde577b93a3c2e60973276992a713358 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 2dfa7e179cb6a56e7c1c7f976f67f6142e21f0a5..5f43a0b826d2eeddc9f62155b87c279f4ccb0760 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 36c1353f249489adf5721b68610933065212e8fc..f6da571707ac2ca2bf81bc75f8a35912e9eadcc3 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);