]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: tda1997x: constify snd_soc_component_driver struct
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Mon, 29 Jul 2024 09:37:37 +0000 (11:37 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 9 Aug 2024 05:56:38 +0000 (07:56 +0200)
`tda1997x_codec_driver` is not modified after its declaration, and it
is only passed to `devm_snd_soc_register_component()`, which expects
a constant `snd_soc_component_driver`.

Move `tda1997x_codec_driver` to a read-only section by declaring it
const.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/tda1997x.c

index 58ce8fec3041a2924f0e589bafe1db649395ed67..3b7e5ff5b010b5525dcc784c92dd0d5b7b544f64 100644 (file)
@@ -2514,7 +2514,7 @@ static void tda1997x_codec_remove(struct snd_soc_component *component)
 {
 }
 
-static struct snd_soc_component_driver tda1997x_codec_driver = {
+static const struct snd_soc_component_driver tda1997x_codec_driver = {
        .probe                  = tda1997x_codec_probe,
        .remove                 = tda1997x_codec_remove,
        .idle_bias_on           = 1,