Skip to content

Commit 23cb076

Browse files
committed
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: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent f7efa9b commit 23cb076

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

sound/firewire/bebob/bebob_pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
214214
struct snd_bebob *bebob = substream->private_data;
215215
int err = 0;
216216

217-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
217+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
218218
unsigned int rate = params_rate(hw_params);
219219
unsigned int frames_per_period = params_period_size(hw_params);
220220
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -236,7 +236,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
236236

237237
mutex_lock(&bebob->mutex);
238238

239-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
239+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
240240
bebob->substreams_counter--;
241241

242242
snd_bebob_stream_stop_duplex(bebob);

sound/firewire/dice/dice-pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
266266
struct snd_dice *dice = substream->private_data;
267267
int err = 0;
268268

269-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
269+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
270270
unsigned int rate = params_rate(hw_params);
271271
unsigned int events_per_period = params_period_size(hw_params);
272272
unsigned int events_per_buffer = params_buffer_size(hw_params);
@@ -293,7 +293,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
293293

294294
mutex_lock(&dice->mutex);
295295

296-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
296+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
297297
--dice->substreams_counter;
298298

299299
snd_dice_stream_stop_duplex(dice);

sound/firewire/digi00x/digi00x-pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
190190
struct snd_dg00x *dg00x = substream->private_data;
191191
int err = 0;
192192

193-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
193+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
194194
unsigned int rate = params_rate(hw_params);
195195
unsigned int frames_per_period = params_period_size(hw_params);
196196
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -212,7 +212,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
212212

213213
mutex_lock(&dg00x->mutex);
214214

215-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
215+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
216216
--dg00x->substreams_counter;
217217

218218
snd_dg00x_stream_stop_duplex(dg00x);

sound/firewire/fireface/ff-pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
230230
struct snd_ff *ff = substream->private_data;
231231
int err = 0;
232232

233-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
233+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
234234
unsigned int rate = params_rate(hw_params);
235235
unsigned int frames_per_period = params_period_size(hw_params);
236236
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -252,7 +252,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
252252

253253
mutex_lock(&ff->mutex);
254254

255-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
255+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
256256
--ff->substreams_counter;
257257

258258
snd_ff_stream_stop_duplex(ff);

sound/firewire/fireworks/fireworks_pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
250250
struct snd_efw *efw = substream->private_data;
251251
int err = 0;
252252

253-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
253+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
254254
unsigned int rate = params_rate(hw_params);
255255
unsigned int frames_per_period = params_period_size(hw_params);
256256
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -272,7 +272,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
272272

273273
mutex_lock(&efw->mutex);
274274

275-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
275+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
276276
--efw->substreams_counter;
277277

278278
snd_efw_stream_stop_duplex(efw);

sound/firewire/motu/motu-pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
210210
struct snd_motu *motu = substream->private_data;
211211
int err = 0;
212212

213-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
213+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
214214
unsigned int rate = params_rate(hw_params);
215215
unsigned int frames_per_period = params_period_size(hw_params);
216216
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -232,7 +232,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
232232

233233
mutex_lock(&motu->mutex);
234234

235-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
235+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
236236
--motu->substreams_counter;
237237

238238
snd_motu_stream_stop_duplex(motu);

sound/firewire/oxfw/oxfw-pcm.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static int pcm_capture_hw_params(struct snd_pcm_substream *substream,
239239
struct snd_oxfw *oxfw = substream->private_data;
240240
int err = 0;
241241

242-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
242+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
243243
unsigned int rate = params_rate(hw_params);
244244
unsigned int channels = params_channels(hw_params);
245245
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,
262262
struct snd_oxfw *oxfw = substream->private_data;
263263
int err = 0;
264264

265-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
265+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
266266
unsigned int rate = params_rate(hw_params);
267267
unsigned int channels = params_channels(hw_params);
268268
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)
286286

287287
mutex_lock(&oxfw->mutex);
288288

289-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
289+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
290290
--oxfw->substreams_count;
291291

292292
snd_oxfw_stream_stop_duplex(oxfw);
@@ -301,7 +301,7 @@ static int pcm_playback_hw_free(struct snd_pcm_substream *substream)
301301

302302
mutex_lock(&oxfw->mutex);
303303

304-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
304+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
305305
--oxfw->substreams_count;
306306

307307
snd_oxfw_stream_stop_duplex(oxfw);

sound/firewire/tascam/tascam-pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
119119
struct snd_tscm *tscm = substream->private_data;
120120
int err = 0;
121121

122-
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) {
122+
if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) {
123123
unsigned int rate = params_rate(hw_params);
124124
unsigned int frames_per_period = params_period_size(hw_params);
125125
unsigned int frames_per_buffer = params_buffer_size(hw_params);
@@ -141,7 +141,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
141141

142142
mutex_lock(&tscm->mutex);
143143

144-
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
144+
if (substream->runtime->state != SNDRV_PCM_STATE_OPEN)
145145
--tscm->substreams_counter;
146146

147147
snd_tscm_stream_stop_duplex(tscm);

0 commit comments

Comments
 (0)