Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <perex@perex.cz>
Link: https://lore.kernel.org/r/20220926135558.26580-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+18 -18
+2 -2
sound/firewire/bebob/bebob_pcm.c
··· 214 214 struct snd_bebob *bebob = substream->private_data; 215 215 int err = 0; 216 216 217 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 217 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 218 218 unsigned int rate = params_rate(hw_params); 219 219 unsigned int frames_per_period = params_period_size(hw_params); 220 220 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 236 236 237 237 mutex_lock(&bebob->mutex); 238 238 239 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 239 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 240 240 bebob->substreams_counter--; 241 241 242 242 snd_bebob_stream_stop_duplex(bebob);
+2 -2
sound/firewire/dice/dice-pcm.c
··· 266 266 struct snd_dice *dice = substream->private_data; 267 267 int err = 0; 268 268 269 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 269 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 270 270 unsigned int rate = params_rate(hw_params); 271 271 unsigned int events_per_period = params_period_size(hw_params); 272 272 unsigned int events_per_buffer = params_buffer_size(hw_params); ··· 293 293 294 294 mutex_lock(&dice->mutex); 295 295 296 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 296 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 297 297 --dice->substreams_counter; 298 298 299 299 snd_dice_stream_stop_duplex(dice);
+2 -2
sound/firewire/digi00x/digi00x-pcm.c
··· 190 190 struct snd_dg00x *dg00x = substream->private_data; 191 191 int err = 0; 192 192 193 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 193 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 194 194 unsigned int rate = params_rate(hw_params); 195 195 unsigned int frames_per_period = params_period_size(hw_params); 196 196 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 212 212 213 213 mutex_lock(&dg00x->mutex); 214 214 215 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 215 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 216 216 --dg00x->substreams_counter; 217 217 218 218 snd_dg00x_stream_stop_duplex(dg00x);
+2 -2
sound/firewire/fireface/ff-pcm.c
··· 230 230 struct snd_ff *ff = substream->private_data; 231 231 int err = 0; 232 232 233 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 233 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 234 234 unsigned int rate = params_rate(hw_params); 235 235 unsigned int frames_per_period = params_period_size(hw_params); 236 236 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 252 252 253 253 mutex_lock(&ff->mutex); 254 254 255 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 255 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 256 256 --ff->substreams_counter; 257 257 258 258 snd_ff_stream_stop_duplex(ff);
+2 -2
sound/firewire/fireworks/fireworks_pcm.c
··· 250 250 struct snd_efw *efw = substream->private_data; 251 251 int err = 0; 252 252 253 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 253 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 254 254 unsigned int rate = params_rate(hw_params); 255 255 unsigned int frames_per_period = params_period_size(hw_params); 256 256 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 272 272 273 273 mutex_lock(&efw->mutex); 274 274 275 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 275 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 276 276 --efw->substreams_counter; 277 277 278 278 snd_efw_stream_stop_duplex(efw);
+2 -2
sound/firewire/motu/motu-pcm.c
··· 210 210 struct snd_motu *motu = substream->private_data; 211 211 int err = 0; 212 212 213 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 213 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 214 214 unsigned int rate = params_rate(hw_params); 215 215 unsigned int frames_per_period = params_period_size(hw_params); 216 216 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 232 232 233 233 mutex_lock(&motu->mutex); 234 234 235 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 235 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 236 236 --motu->substreams_counter; 237 237 238 238 snd_motu_stream_stop_duplex(motu);
+4 -4
sound/firewire/oxfw/oxfw-pcm.c
··· 239 239 struct snd_oxfw *oxfw = substream->private_data; 240 240 int err = 0; 241 241 242 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 242 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 243 243 unsigned int rate = params_rate(hw_params); 244 244 unsigned int channels = params_channels(hw_params); 245 245 unsigned int frames_per_period = params_period_size(hw_params); ··· 262 262 struct snd_oxfw *oxfw = substream->private_data; 263 263 int err = 0; 264 264 265 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 265 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 266 266 unsigned int rate = params_rate(hw_params); 267 267 unsigned int channels = params_channels(hw_params); 268 268 unsigned int frames_per_period = params_period_size(hw_params); ··· 286 286 287 287 mutex_lock(&oxfw->mutex); 288 288 289 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 289 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 290 290 --oxfw->substreams_count; 291 291 292 292 snd_oxfw_stream_stop_duplex(oxfw); ··· 301 301 302 302 mutex_lock(&oxfw->mutex); 303 303 304 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 304 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 305 305 --oxfw->substreams_count; 306 306 307 307 snd_oxfw_stream_stop_duplex(oxfw);
+2 -2
sound/firewire/tascam/tascam-pcm.c
··· 119 119 struct snd_tscm *tscm = substream->private_data; 120 120 int err = 0; 121 121 122 - if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { 122 + if (substream->runtime->state == SNDRV_PCM_STATE_OPEN) { 123 123 unsigned int rate = params_rate(hw_params); 124 124 unsigned int frames_per_period = params_period_size(hw_params); 125 125 unsigned int frames_per_buffer = params_buffer_size(hw_params); ··· 141 141 142 142 mutex_lock(&tscm->mutex); 143 143 144 - if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) 144 + if (substream->runtime->state != SNDRV_PCM_STATE_OPEN) 145 145 --tscm->substreams_counter; 146 146 147 147 snd_tscm_stream_stop_duplex(tscm);