Commit 23cb0767 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: firewire: Replace runtime->status->state reference to runtime->state



The recent change in ALSA core allows drivers to get the current PCM
state directly from runtime object.  Replace the calls accordingly.

Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-5-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f7efa9b8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
Loading