Преглед на файлове

ASoC: fsl: constify snd_pcm_ops structures

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>
Arvind Yadav преди 8 години
родител
ревизия
b6ed072028
променени са 3 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      sound/soc/fsl/fsl_dma.c
  2. 1 1
      sound/soc/fsl/imx-pcm-fiq.c
  3. 1 1
      sound/soc/fsl/mpc5200_dma.c

+ 1 - 1
sound/soc/fsl/fsl_dma.c

@@ -870,7 +870,7 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
 	return NULL;
 	return NULL;
 }
 }
 
 
-static struct snd_pcm_ops fsl_dma_ops = {
+static const struct snd_pcm_ops fsl_dma_ops = {
 	.open   	= fsl_dma_open,
 	.open   	= fsl_dma_open,
 	.close  	= fsl_dma_close,
 	.close  	= fsl_dma_close,
 	.ioctl  	= snd_pcm_lib_ioctl,
 	.ioctl  	= snd_pcm_lib_ioctl,

+ 1 - 1
sound/soc/fsl/imx-pcm-fiq.c

@@ -227,7 +227,7 @@ static int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
 	return ret;
 	return ret;
 }
 }
 
 
-static struct snd_pcm_ops imx_pcm_ops = {
+static const struct snd_pcm_ops imx_pcm_ops = {
 	.open		= snd_imx_open,
 	.open		= snd_imx_open,
 	.close		= snd_imx_close,
 	.close		= snd_imx_close,
 	.ioctl		= snd_pcm_lib_ioctl,
 	.ioctl		= snd_pcm_lib_ioctl,

+ 1 - 1
sound/soc/fsl/mpc5200_dma.c

@@ -287,7 +287,7 @@ psc_dma_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 	return 0;
 }
 }
 
 
-static struct snd_pcm_ops psc_dma_ops = {
+static const struct snd_pcm_ops psc_dma_ops = {
 	.open		= psc_dma_open,
 	.open		= psc_dma_open,
 	.close		= psc_dma_close,
 	.close		= psc_dma_close,
 	.hw_free	= psc_dma_hw_free,
 	.hw_free	= psc_dma_hw_free,