diff mbox series

[1/2] media: i2c: tvp5150: Constify struct regmap_config

Message ID 20240705-media-const-regmap_config-v1-1-56881442bb30@gmail.com (mailing list archive)
State New
Headers show
Series media: Constify struct regmap_config | expand

Commit Message

Javier Carrasco July 5, 2024, 10:53 a.m. UTC
`tvp5150_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/media/i2c/tvp5150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans Verkuil Aug. 7, 2024, 10 a.m. UTC | #1
On 05/07/2024 12:53, Javier Carrasco wrote:
> `tvp5150_config` is not modified and can be declared as const to
> move its data to a read-only section.

This is a duplicate of:

https://patchwork.linuxtv.org/project/linux-media/patch/119b3ec62e6305c83ffadc7f40cbda9fc3d5be11.1714893773.git.christophe.jaillet@wanadoo.fr/

I'll take that one since that also constifies i2c_vbi_ram_value.

Regards,

	Hans

> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  drivers/media/i2c/tvp5150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
> index 64b91aa3c82a..3205ecd60281 100644
> --- a/drivers/media/i2c/tvp5150.c
> +++ b/drivers/media/i2c/tvp5150.c
> @@ -1812,7 +1812,7 @@ static const struct regmap_access_table tvp5150_readable_table = {
>  	.n_yes_ranges = ARRAY_SIZE(tvp5150_readable_ranges),
>  };
>  
> -static struct regmap_config tvp5150_config = {
> +static const struct regmap_config tvp5150_config = {
>  	.reg_bits = 8,
>  	.val_bits = 8,
>  	.max_register = 0xff,
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 64b91aa3c82a..3205ecd60281 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -1812,7 +1812,7 @@  static const struct regmap_access_table tvp5150_readable_table = {
 	.n_yes_ranges = ARRAY_SIZE(tvp5150_readable_ranges),
 };
 
-static struct regmap_config tvp5150_config = {
+static const struct regmap_config tvp5150_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.max_register = 0xff,