diff mbox series

[5/6] drm/panel: ili9322: Constify struct regmap_bus

Message ID 20240925-drm-const-regmap-v1-5-e609d502401b@gmail.com (mailing list archive)
State New
Headers show
Series drm: constify read-only regmap structs | expand

Commit Message

Javier Carrasco Sept. 25, 2024, 3:42 p.m. UTC
`ili9322_regmap_bus` 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/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neil Armstrong Sept. 30, 2024, 2:28 p.m. UTC | #1
On 25/09/2024 17:42, Javier Carrasco wrote:
> `ili9322_regmap_bus` 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/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> index 4a6dcfd781e8..94b7dfef3b5e 100644
> --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
> @@ -318,7 +318,7 @@ static int ili9322_regmap_spi_read(void *context, const void *reg,
>   	return spi_write_then_read(spi, buf, 1, val, 1);
>   }
>   
> -static struct regmap_bus ili9322_regmap_bus = {
> +static const struct regmap_bus ili9322_regmap_bus = {
>   	.write = ili9322_regmap_spi_write,
>   	.read = ili9322_regmap_spi_read,
>   	.reg_format_endian_default = REGMAP_ENDIAN_BIG,
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index 4a6dcfd781e8..94b7dfef3b5e 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -318,7 +318,7 @@  static int ili9322_regmap_spi_read(void *context, const void *reg,
 	return spi_write_then_read(spi, buf, 1, val, 1);
 }
 
-static struct regmap_bus ili9322_regmap_bus = {
+static const struct regmap_bus ili9322_regmap_bus = {
 	.write = ili9322_regmap_spi_write,
 	.read = ili9322_regmap_spi_read,
 	.reg_format_endian_default = REGMAP_ENDIAN_BIG,