Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85e7652d authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: Constify snd_soc_dai_ops structs



Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure")
introduced the possibility to have constant DAI ops structures, yet this is
barley used in both existing drivers and also new drivers being submitted,
although none of them modifies its DAI ops structure. The later is not
surprising since existing drivers are often used as templates for new drivers.
So this patch just constifies all existing snd_soc_dai_ops structs to eliminate
the issue altogether.

The patch was generated with the following coccinelle semantic patch:
// <smpl>
@@
identifier ops;
@@
-struct snd_soc_dai_ops ops =
+const struct snd_soc_dai_ops ops =
{ ... };
// </smpl>

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent bea0ed08
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -719,7 +719,7 @@ static int atmel_ssc_remove(struct snd_soc_dai *dai)
#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8     | SNDRV_PCM_FMTBIT_S16_LE |\
			  SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops atmel_ssc_dai_ops = {
static const struct snd_soc_dai_ops atmel_ssc_dai_ops = {
	.startup	= atmel_ssc_startup,
	.shutdown	= atmel_ssc_shutdown,
	.prepare	= atmel_ssc_prepare,
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ static int alchemy_ac97c_startup(struct snd_pcm_substream *substream,
	return 0;
}

static struct snd_soc_dai_ops alchemy_ac97c_ops = {
static const struct snd_soc_dai_ops alchemy_ac97c_ops = {
	.startup		= alchemy_ac97c_startup,
};

+1 −1
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ static int au1xi2s_startup(struct snd_pcm_substream *substream,
	return 0;
}

static const struct snd_soc_dai_ops au1xi2s_dai_ops = {
static const const struct snd_soc_dai_ops au1xi2s_dai_ops = {
	.startup	= au1xi2s_startup,
	.trigger	= au1xi2s_trigger,
	.hw_params	= au1xi2s_hw_params,
+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ static int au1xpsc_ac97_probe(struct snd_soc_dai *dai)
	return au1xpsc_ac97_workdata ? 0 : -ENODEV;
}

static struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = {
static const struct snd_soc_dai_ops au1xpsc_ac97_dai_ops = {
	.startup	= au1xpsc_ac97_startup,
	.trigger	= au1xpsc_ac97_trigger,
	.hw_params	= au1xpsc_ac97_hw_params,
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static int au1xpsc_i2s_startup(struct snd_pcm_substream *substream,
	return 0;
}

static struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = {
static const struct snd_soc_dai_ops au1xpsc_i2s_dai_ops = {
	.startup	= au1xpsc_i2s_startup,
	.trigger	= au1xpsc_i2s_trigger,
	.hw_params	= au1xpsc_i2s_hw_params,
Loading