ASoC: fsl: constify snd_pcm_ops structures
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Mon, 14 Aug 2017 05:56:26 +0000 (11:26 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2017 16:17:53 +0000 (17:17 +0100)
snd_pcm_ops are not supposed to change at runtime. All functions
working with snd_pcm_ops provided by <sound/soc.h> work with
const snd_pcm_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_dma.c
sound/soc/fsl/imx-pcm-fiq.c
sound/soc/fsl/mpc5200_dma.c

index ed8ea002902d21843a8b36287dc2938a522663e2..979ed1b3ecc45c58ed9685bbf00391cd09156e19 100644 (file)
@@ -870,7 +870,7 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
        return NULL;
 }
 
-static struct snd_pcm_ops fsl_dma_ops = {
+static const struct snd_pcm_ops fsl_dma_ops = {
        .open           = fsl_dma_open,
        .close          = fsl_dma_close,
        .ioctl          = snd_pcm_lib_ioctl,
index 92410f7ca1fafab6dcf6132808c758eea49f67c1..9ce37616ef5d04e57871f32b4cb108c55fd52236 100644 (file)
@@ -227,7 +227,7 @@ static int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
        return ret;
 }
 
-static struct snd_pcm_ops imx_pcm_ops = {
+static const struct snd_pcm_ops imx_pcm_ops = {
        .open           = snd_imx_open,
        .close          = snd_imx_close,
        .ioctl          = snd_pcm_lib_ioctl,
index 1f7e70bfbd5506a4088143d8ee9dfff0e059ee2d..66042ce86edcc7a14bc7cc686e082537edf8c47f 100644 (file)
@@ -287,7 +287,7 @@ psc_dma_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_pcm_ops psc_dma_ops = {
+static const struct snd_pcm_ops psc_dma_ops = {
        .open           = psc_dma_open,
        .close          = psc_dma_close,
        .hw_free        = psc_dma_hw_free,