Skip to content

Commit

Permalink
ASoC: max98925: Constify regmap config and other codec data
Browse files Browse the repository at this point in the history
Constify local structures (snd_soc_dai_ops, snd_soc_codec_driver,
regmap_config) and array (reg_defaults) which are not modified by the
driver and passed to core as pointer to const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Mar 20, 2015
1 parent 718b25c commit 9cd974b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/soc/codecs/max98925.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static const char *const hpf_text[] = {
"Disable", "DC Block", "100Hz", "200Hz", "400Hz", "800Hz",
};

static struct reg_default max98925_reg[] = {
static const struct reg_default max98925_reg[] = {
{ 0x0B, 0x00 }, /* IRQ Enable0 */
{ 0x0C, 0x00 }, /* IRQ Enable1 */
{ 0x0D, 0x00 }, /* IRQ Enable2 */
Expand Down Expand Up @@ -491,7 +491,7 @@ static int max98925_dai_set_sysclk(struct snd_soc_dai *dai,
#define MAX98925_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)

static struct snd_soc_dai_ops max98925_dai_ops = {
static const struct snd_soc_dai_ops max98925_dai_ops = {
.set_sysclk = max98925_dai_set_sysclk,
.set_fmt = max98925_dai_set_fmt,
.hw_params = max98925_dai_hw_params,
Expand Down Expand Up @@ -541,7 +541,7 @@ static int max98925_probe(struct snd_soc_codec *codec)
return 0;
}

static struct snd_soc_codec_driver soc_codec_dev_max98925 = {
static const struct snd_soc_codec_driver soc_codec_dev_max98925 = {
.probe = max98925_probe,
.controls = max98925_snd_controls,
.num_controls = ARRAY_SIZE(max98925_snd_controls),
Expand All @@ -551,7 +551,7 @@ static struct snd_soc_codec_driver soc_codec_dev_max98925 = {
.num_dapm_widgets = ARRAY_SIZE(max98925_dapm_widgets),
};

static struct regmap_config max98925_regmap = {
static const struct regmap_config max98925_regmap = {
.reg_bits = 8,
.val_bits = 8,
.max_register = MAX98925_REV_VERSION,
Expand Down

0 comments on commit 9cd974b

Please sign in to comment.