mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: amd: Explain component open return value handling
Add comments explaining why the .open() callbacks must return 0 on success to ensure proper rollback handling and prevent future changes from reintroducing the issue. Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20261016040946.521195-2-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
303961c7da
commit
1ba2cb30ee
|
|
@ -248,6 +248,11 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs
|
|||
list_add_tail(&stream->list, &chip->stream_list);
|
||||
spin_unlock_irq(&chip->acp_lock);
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -211,6 +211,12 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component,
|
|||
|
||||
pdm_data->acp63_base = adata->acp63_base;
|
||||
runtime->private_data = pdm_data;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -337,6 +337,12 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component,
|
|||
stream->stream_id = cpu_dai->id;
|
||||
stream->instance = amd_manager->instance;
|
||||
runtime->private_data = stream;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -237,6 +237,12 @@ static int acp3x_dma_open(struct snd_soc_component *component,
|
|||
|
||||
i2s_data->acp3x_base = adata->acp3x_base;
|
||||
runtime->private_data = i2s_data;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,6 +233,12 @@ static int acp_pdm_dma_open(struct snd_soc_component *component,
|
|||
|
||||
pdm_data->acp_base = adata->acp_base;
|
||||
runtime->private_data = pdm_data;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -231,6 +231,12 @@ static int acp5x_dma_open(struct snd_soc_component *component,
|
|||
}
|
||||
i2s_data->acp5x_base = adata->acp5x_base;
|
||||
runtime->private_data = i2s_data;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -209,6 +209,12 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component,
|
|||
|
||||
pdm_data->acp6x_base = adata->acp6x_base;
|
||||
runtime->private_data = pdm_data;
|
||||
|
||||
/*
|
||||
* ASoC only marks the component as opened when .open() returns 0.
|
||||
* Since snd_pcm_hw_constraint_integer() may return 1, explicitly
|
||||
* return 0 to ensure .close() is not skipped on rollback.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user