Commit f13478c9 authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Maxime Ripard

drm/sun4i: Constify static structs

A number of static variables are not modified and can be made const to
allow the compiler to put them in read-only memory.
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804215337.54594-1-rikard.falkeborn@gmail.com
parent c84adb30
...@@ -769,7 +769,7 @@ static const struct sunxi_engine_ops sun4i_backend_engine_ops = { ...@@ -769,7 +769,7 @@ static const struct sunxi_engine_ops sun4i_backend_engine_ops = {
.vblank_quirk = sun4i_backend_vblank_quirk, .vblank_quirk = sun4i_backend_vblank_quirk,
}; };
static struct regmap_config sun4i_backend_regmap_config = { static const struct regmap_config sun4i_backend_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -35,7 +35,7 @@ static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = { ...@@ -35,7 +35,7 @@ static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = {
.fb_create = drm_gem_fb_create, .fb_create = drm_gem_fb_create,
}; };
static struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = { static const struct drm_mode_config_helper_funcs sun4i_de_mode_config_helpers = {
.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
}; };
......
...@@ -545,7 +545,7 @@ int sun4i_frontend_enable(struct sun4i_frontend *frontend) ...@@ -545,7 +545,7 @@ int sun4i_frontend_enable(struct sun4i_frontend *frontend)
} }
EXPORT_SYMBOL(sun4i_frontend_enable); EXPORT_SYMBOL(sun4i_frontend_enable);
static struct regmap_config sun4i_frontend_regmap_config = { static const struct regmap_config sun4i_frontend_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -47,7 +47,7 @@ static int sun4i_lvds_get_modes(struct drm_connector *connector) ...@@ -47,7 +47,7 @@ static int sun4i_lvds_get_modes(struct drm_connector *connector)
return drm_panel_get_modes(lvds->panel, connector); return drm_panel_get_modes(lvds->panel, connector);
} }
static struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = { static const struct drm_connector_helper_funcs sun4i_lvds_con_helper_funcs = {
.get_modes = sun4i_lvds_get_modes, .get_modes = sun4i_lvds_get_modes,
}; };
......
...@@ -138,7 +138,7 @@ static enum drm_mode_status sun4i_rgb_mode_valid(struct drm_encoder *crtc, ...@@ -138,7 +138,7 @@ static enum drm_mode_status sun4i_rgb_mode_valid(struct drm_encoder *crtc,
return MODE_OK; return MODE_OK;
} }
static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { static const struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = {
.get_modes = sun4i_rgb_get_modes, .get_modes = sun4i_rgb_get_modes,
}; };
...@@ -180,7 +180,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder) ...@@ -180,7 +180,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder)
} }
} }
static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { static const struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = {
.disable = sun4i_rgb_encoder_disable, .disable = sun4i_rgb_encoder_disable,
.enable = sun4i_rgb_encoder_enable, .enable = sun4i_rgb_encoder_enable,
.mode_valid = sun4i_rgb_mode_valid, .mode_valid = sun4i_rgb_mode_valid,
......
...@@ -825,7 +825,7 @@ static int sun4i_tcon_init_irq(struct device *dev, ...@@ -825,7 +825,7 @@ static int sun4i_tcon_init_irq(struct device *dev,
return 0; return 0;
} }
static struct regmap_config sun4i_tcon_regmap_config = { static const struct regmap_config sun4i_tcon_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -468,7 +468,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder, ...@@ -468,7 +468,7 @@ static void sun4i_tv_mode_set(struct drm_encoder *encoder,
regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0);
} }
static struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = {
.disable = sun4i_tv_disable, .disable = sun4i_tv_disable,
.enable = sun4i_tv_enable, .enable = sun4i_tv_enable,
.mode_set = sun4i_tv_mode_set, .mode_set = sun4i_tv_mode_set,
...@@ -504,7 +504,7 @@ static int sun4i_tv_comp_mode_valid(struct drm_connector *connector, ...@@ -504,7 +504,7 @@ static int sun4i_tv_comp_mode_valid(struct drm_connector *connector,
return MODE_OK; return MODE_OK;
} }
static struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = { static const struct drm_connector_helper_funcs sun4i_tv_comp_connector_helper_funcs = {
.get_modes = sun4i_tv_comp_get_modes, .get_modes = sun4i_tv_comp_get_modes,
.mode_valid = sun4i_tv_comp_mode_valid, .mode_valid = sun4i_tv_comp_mode_valid,
}; };
...@@ -523,7 +523,7 @@ static const struct drm_connector_funcs sun4i_tv_comp_connector_funcs = { ...@@ -523,7 +523,7 @@ static const struct drm_connector_funcs sun4i_tv_comp_connector_funcs = {
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
}; };
static struct regmap_config sun4i_tv_regmap_config = { static const struct regmap_config sun4i_tv_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -820,7 +820,7 @@ static int sun6i_dsi_get_modes(struct drm_connector *connector) ...@@ -820,7 +820,7 @@ static int sun6i_dsi_get_modes(struct drm_connector *connector)
return drm_panel_get_modes(dsi->panel, connector); return drm_panel_get_modes(dsi->panel, connector);
} }
static struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = { static const struct drm_connector_helper_funcs sun6i_dsi_connector_helper_funcs = {
.get_modes = sun6i_dsi_get_modes, .get_modes = sun6i_dsi_get_modes,
}; };
......
...@@ -534,7 +534,7 @@ void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy, ...@@ -534,7 +534,7 @@ void sun8i_hdmi_phy_set_ops(struct sun8i_hdmi_phy *phy,
} }
} }
static struct regmap_config sun8i_hdmi_phy_regmap_config = { static const struct regmap_config sun8i_hdmi_phy_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -303,7 +303,7 @@ static const struct sunxi_engine_ops sun8i_engine_ops = { ...@@ -303,7 +303,7 @@ static const struct sunxi_engine_ops sun8i_engine_ops = {
.layers_init = sun8i_layers_init, .layers_init = sun8i_layers_init,
}; };
static struct regmap_config sun8i_mixer_regmap_config = { static const struct regmap_config sun8i_mixer_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
......
...@@ -298,7 +298,7 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane, ...@@ -298,7 +298,7 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane,
true, zpos, old_zpos); true, zpos, old_zpos);
} }
static struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = { static const struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = {
.prepare_fb = drm_gem_fb_prepare_fb, .prepare_fb = drm_gem_fb_prepare_fb,
.atomic_check = sun8i_ui_layer_atomic_check, .atomic_check = sun8i_ui_layer_atomic_check,
.atomic_disable = sun8i_ui_layer_atomic_disable, .atomic_disable = sun8i_ui_layer_atomic_disable,
......
...@@ -401,7 +401,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane, ...@@ -401,7 +401,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
true, zpos, old_zpos); true, zpos, old_zpos);
} }
static struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = { static const struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = {
.prepare_fb = drm_gem_fb_prepare_fb, .prepare_fb = drm_gem_fb_prepare_fb,
.atomic_check = sun8i_vi_layer_atomic_check, .atomic_check = sun8i_vi_layer_atomic_check,
.atomic_disable = sun8i_vi_layer_atomic_disable, .atomic_disable = sun8i_vi_layer_atomic_disable,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment