drm: constify read-only regmap structs
Subsystems (11)
cover drm: constify read-only regmap structs
This series adds the const modifier to the remaining regmap_bus and regmap_config structs under drm/ that are effectively used as const (i.e., only read after their declaration), but kept ad writtable data.
---
Javier Carrasco (6):
drm/bridge: dpc3433: Constify struct regmap_config drm/fsl-dcu: Constify struct regmap_config drm/mediatek: dp: Constify struct regmap_config drm/meson: Constify struct regmap_config drm/panel: ili9322: Constify struct regmap_bus drm/sprd: Constify struct regmap_bus
drivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 2 +- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +- drivers/gpu/drm/sprd/sprd_dsi.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
---
base-commit: 2b7275670032a98cba266bd1b8905f755b3e650f
change-id: 20240925-drm-const-regmap-307f2c358d10
Best regards,
Signature · 1 line
Javier Carrasco <[email protected]>
PATCH 1/6 drm/bridge: dpc3433: Constify struct regmap_config
dlpc_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-dlpc3433.c +1 -1
@@ -94,7 +94,7 @@ static const struct regmap_access_table dlpc_volatile_table = { .n_yes_ranges = ARRAY_SIZE(dlpc_volatile_ranges), }; -static struct regmap_config dlpc_regmap_config = { +static const struct regmap_config dlpc_regmap_config = { .reg_bits =8 , .val_bits =8 , .max_register =WR_DSI_PORT_EN ,
Signature · 1 line
2.43.0
PATCH 2/6 drm/fsl-dcu: Constify struct regmap_config
In reply to Javier Carrascofsl_tcon_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_tcon.c +1 -1
@@ -29,7 +29,7 @@ void fsl_tcon_bypass_enable(struct fsl_tcon *tcon) FSL_TCON_CTRL1_TCON_BYPASS); } -static struct regmap_config fsl_tcon_regmap_config = { +static const struct regmap_config fsl_tcon_regmap_config = { .reg_bits =32 , .reg_stride =4 , .val_bits =32 ,
Signature · 1 line
2.43.0
PATCH 3/6 drm/mediatek: dp: Constify struct regmap_config
In reply to Javier Carrascomtk_dp_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dp.c +1 -1
@@ -311,7 +311,7 @@ static const struct mtk_dp_efuse_fmt mt8195_dp_efuse_fmt[MTK_DP_CAL_MAX] = { }, }; -static struct regmap_config mtk_dp_regmap_config = { +static const struct regmap_config mtk_dp_regmap_config = { .reg_bits =32 , .val_bits =32 , .reg_stride =4 ,
Signature · 1 line
2.43.0
PATCH 4/6 drm/meson: Constify struct regmap_config
In reply to Javier Carrascomeson_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/meson/meson_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +1 -1
@@ -126,7 +126,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)return false; } -static struct regmap_config meson_regmap_config = { +static const struct regmap_config meson_regmap_config = { .reg_bits =32 , .val_bits =32 , .reg_stride =4 ,
Signature · 1 line
2.43.0
PATCH 5/6 drm/panel: ili9322: Constify struct regmap_bus
In reply to Javier Carrascoili9322_regmap_bus is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +1 -1
@@ -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 ,
Signature · 1 line
2.43.0
Re: [PATCH 5/6] drm/panel: ili9322: Constify struct regmap_bus
Quoted 14 lines · Javier Carrasco
ili9322_regmap_busis not modified and can be declared as const to move its data to a read-only section.Signed-off-by Javier Carrasco <[email protected]>--- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/panel/panel-ilitek-ili9322.c +0
-0
drivers/gpu/drm/panel/panel-ilitek-ili9322.c static int ili9322_regmap_spi_read(void *context, const void *reg, · line 324
Quoted 8 lines
drivers/gpu/drm/panel/panel-ilitek-ili9322.c +1
-1@@ -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 ,
PATCH 6/6 drm/sprd: Constify struct regmap_bus
In reply to Javier Carrascoregmap_txt_io is not modified and can be declared as const to move its data to a read-only section.
--- drivers/gpu/drm/sprd/sprd_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sprd/sprd_dsi.c +1 -1
@@ -209,7 +209,7 @@ static int regmap_tst_io_read(void *context, u32 reg, u32 *val)return 0 ; } -static struct regmap_bus regmap_tst_io = { +static const struct regmap_bus regmap_tst_io = { .reg_write = regmap_tst_io_write, .reg_read = regmap_tst_io_read, };
Signature · 1 line
2.43.0
Quoted 5 lines · Javier Carrasco
This series adds the const modifier to the remaining
regmap_busandregmap_configstructs under drm/ that are effectively used as const (i.e., only read after their declaration), but kept ad writtable data.Signed-off-by Javier Carrasco <[email protected]>
Quoted 9 lines
---
Javier Carrasco (6):
drm/bridge: dpc3433: Constify structregmap_configdrm/fsl-dcu: Constify structregmap_configdrm/mediatek: dp: Constify structregmap_configdrm/meson: Constify structregmap_configdrm/panel: ili9322: Constify structregmap_busdrm/sprd: Constify structregmap_bus
For the series:
Signature · 2 lines
With best wishes Dmitry
Il 25/09/24 17:42, Javier Carrasco ha scritto:
Quoted 5 lines
This series adds the const modifier to the remaining
regmap_busandregmap_configstructs under drm/ that are effectively used as const (i.e., only read after their declaration), but kept ad writtable data.Signed-off-by Javier Carrasco <[email protected]>
For the entire series:
Quoted 21 lines
---
Javier Carrasco (6):
drm/bridge: dpc3433: Constify structregmap_configdrm/fsl-dcu: Constify structregmap_configdrm/mediatek: dp: Constify structregmap_configdrm/meson: Constify structregmap_configdrm/panel: ili9322: Constify structregmap_busdrm/sprd: Constify structregmap_busdrivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +- drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 2 +- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 2 +- drivers/gpu/drm/sprd/sprd_dsi.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)---
base-commit:2b7275670032a98cba266bd1b8905f755b3e650f
change-id: 20240925-drm-const-regmap-307f2c358d10Best regards,
Dmitry Baryshkov
AppliedQuoted 5 lines · Javier Carrasco
This series adds the const modifier to the remaining
regmap_busandregmap_configstructs under drm/ that are effectively used as const (i.e., only read after their declaration), but kept ad writtable data.
Applied to drm-misc-next, thanks!
[1/6] drm/bridge: dpc3433: Constify struct regmap_config
commit: b895a1805e0b01d523afa71818cb97a5d2655fcf
[2/6] drm/fsl-dcu: Constify struct regmap_config
commit: 9239d961ce9d95ec13e241407d0320228e664d68
[3/6] drm/mediatek: dp: Constify struct regmap_config
commit: 02f686d17c4305a0b5e2a9de749664dfe9c0f63e
[4/6] drm/meson: Constify struct regmap_config
commit: 0bcbddb7ef0edb8b4ca994033128e955bb8b1b74
[5/6] drm/panel: ili9322: Constify struct regmap_bus
commit: 6a92271233fb4789f69a9ba9410b23e2e5ab30e2
[6/6] drm/sprd: Constify struct regmap_bus
commit: 420fb223fe6049f5eecac0d28136df5bc5699ea2Best regards,
Signature · 2 lines
With best wishes Dmitry