Skip to content

Commit

Permalink
ASoC: rk817: Constify static struct snd_soc_dai_ops
Browse files Browse the repository at this point in the history
The snd_soc_dai_ops structures is only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structure
const to allow the compiler to put it in read-only memory.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Wei Yongjun authored and broonie committed Jun 18, 2021
1 parent eb1e9b8 commit 45ce213
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/codecs/rk817_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ static int rk817_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops rk817_dai_ops = {
static const struct snd_soc_dai_ops rk817_dai_ops = {
.hw_params = rk817_hw_params,
.set_fmt = rk817_set_dai_fmt,
.set_sysclk = rk817_set_dai_sysclk,
Expand Down

0 comments on commit 45ce213

Please sign in to comment.