diff options
author | Jani Nikula <jani.nikula@intel.com> | 2015-03-11 05:51:06 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-04-07 12:11:25 -0400 |
commit | be26a66de5f5722388966a62d772df832818bcb9 (patch) | |
tree | d004bf6ddcb0069e3d6e5879ebe95ed3c1e37980 /drivers/gpu/drm/drm_crtc_helper.c | |
parent | 71279a11380faabf70ea2827dc168b4156a10971 (diff) |
drm/drm: constify all struct drm_*_helper funcs pointers
They are not to be modified.
Generated using the semantic patch:
@@
@@
(
const struct drm_crtc_helper_funcs *
|
- struct drm_crtc_helper_funcs *
+ const struct drm_crtc_helper_funcs *
)
@@
@@
(
const struct drm_encoder_helper_funcs *
|
- struct drm_encoder_helper_funcs *
+ const struct drm_encoder_helper_funcs *
)
@@
@@
(
const struct drm_connector_helper_funcs *
|
- struct drm_connector_helper_funcs *
+ const struct drm_connector_helper_funcs *
)
@@
@@
(
const struct drm_plane_helper_funcs *
|
- struct drm_plane_helper_funcs *
+ const struct drm_plane_helper_funcs *
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index dd895c409ca3..ab00286aec93 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(drm_helper_crtc_in_use); | |||
161 | static void | 161 | static void |
162 | drm_encoder_disable(struct drm_encoder *encoder) | 162 | drm_encoder_disable(struct drm_encoder *encoder) |
163 | { | 163 | { |
164 | struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; | 164 | const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; |
165 | 165 | ||
166 | if (encoder->bridge) | 166 | if (encoder->bridge) |
167 | encoder->bridge->funcs->disable(encoder->bridge); | 167 | encoder->bridge->funcs->disable(encoder->bridge); |
@@ -191,7 +191,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 193 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
194 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 194 | const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
195 | crtc->enabled = drm_helper_crtc_in_use(crtc); | 195 | crtc->enabled = drm_helper_crtc_in_use(crtc); |
196 | if (!crtc->enabled) { | 196 | if (!crtc->enabled) { |
197 | if (crtc_funcs->disable) | 197 | if (crtc_funcs->disable) |
@@ -229,7 +229,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions); | |||
229 | static void | 229 | static void |
230 | drm_crtc_prepare_encoders(struct drm_device *dev) | 230 | drm_crtc_prepare_encoders(struct drm_device *dev) |
231 | { | 231 | { |
232 | struct drm_encoder_helper_funcs *encoder_funcs; | 232 | const struct drm_encoder_helper_funcs *encoder_funcs; |
233 | struct drm_encoder *encoder; | 233 | struct drm_encoder *encoder; |
234 | 234 | ||
235 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 235 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
@@ -271,8 +271,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
271 | { | 271 | { |
272 | struct drm_device *dev = crtc->dev; | 272 | struct drm_device *dev = crtc->dev; |
273 | struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; | 273 | struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; |
274 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 274 | const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
275 | struct drm_encoder_helper_funcs *encoder_funcs; | 275 | const struct drm_encoder_helper_funcs *encoder_funcs; |
276 | int saved_x, saved_y; | 276 | int saved_x, saved_y; |
277 | bool saved_enabled; | 277 | bool saved_enabled; |
278 | struct drm_encoder *encoder; | 278 | struct drm_encoder *encoder; |
@@ -473,7 +473,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
473 | bool fb_changed = false; /* if true and !mode_changed just do a flip */ | 473 | bool fb_changed = false; /* if true and !mode_changed just do a flip */ |
474 | struct drm_connector *save_connectors, *connector; | 474 | struct drm_connector *save_connectors, *connector; |
475 | int count = 0, ro, fail = 0; | 475 | int count = 0, ro, fail = 0; |
476 | struct drm_crtc_helper_funcs *crtc_funcs; | 476 | const struct drm_crtc_helper_funcs *crtc_funcs; |
477 | struct drm_mode_set save_set; | 477 | struct drm_mode_set save_set; |
478 | int ret; | 478 | int ret; |
479 | int i; | 479 | int i; |
@@ -573,7 +573,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
573 | /* a) traverse passed in connector list and get encoders for them */ | 573 | /* a) traverse passed in connector list and get encoders for them */ |
574 | count = 0; | 574 | count = 0; |
575 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 575 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
576 | struct drm_connector_helper_funcs *connector_funcs = | 576 | const struct drm_connector_helper_funcs *connector_funcs = |
577 | connector->helper_private; | 577 | connector->helper_private; |
578 | new_encoder = connector->encoder; | 578 | new_encoder = connector->encoder; |
579 | for (ro = 0; ro < set->num_connectors; ro++) { | 579 | for (ro = 0; ro < set->num_connectors; ro++) { |
@@ -733,7 +733,7 @@ static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) | |||
733 | static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) | 733 | static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) |
734 | { | 734 | { |
735 | struct drm_bridge *bridge = encoder->bridge; | 735 | struct drm_bridge *bridge = encoder->bridge; |
736 | struct drm_encoder_helper_funcs *encoder_funcs; | 736 | const struct drm_encoder_helper_funcs *encoder_funcs; |
737 | 737 | ||
738 | if (bridge) { | 738 | if (bridge) { |
739 | if (mode == DRM_MODE_DPMS_ON) | 739 | if (mode == DRM_MODE_DPMS_ON) |
@@ -795,7 +795,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode) | |||
795 | /* from off to on, do crtc then encoder */ | 795 | /* from off to on, do crtc then encoder */ |
796 | if (mode < old_dpms) { | 796 | if (mode < old_dpms) { |
797 | if (crtc) { | 797 | if (crtc) { |
798 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 798 | const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
799 | if (crtc_funcs->dpms) | 799 | if (crtc_funcs->dpms) |
800 | (*crtc_funcs->dpms) (crtc, | 800 | (*crtc_funcs->dpms) (crtc, |
801 | drm_helper_choose_crtc_dpms(crtc)); | 801 | drm_helper_choose_crtc_dpms(crtc)); |
@@ -809,7 +809,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode) | |||
809 | if (encoder) | 809 | if (encoder) |
810 | drm_helper_encoder_dpms(encoder, encoder_dpms); | 810 | drm_helper_encoder_dpms(encoder, encoder_dpms); |
811 | if (crtc) { | 811 | if (crtc) { |
812 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 812 | const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
813 | if (crtc_funcs->dpms) | 813 | if (crtc_funcs->dpms) |
814 | (*crtc_funcs->dpms) (crtc, | 814 | (*crtc_funcs->dpms) (crtc, |
815 | drm_helper_choose_crtc_dpms(crtc)); | 815 | drm_helper_choose_crtc_dpms(crtc)); |
@@ -871,7 +871,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev) | |||
871 | { | 871 | { |
872 | struct drm_crtc *crtc; | 872 | struct drm_crtc *crtc; |
873 | struct drm_encoder *encoder; | 873 | struct drm_encoder *encoder; |
874 | struct drm_crtc_helper_funcs *crtc_funcs; | 874 | const struct drm_crtc_helper_funcs *crtc_funcs; |
875 | int encoder_dpms; | 875 | int encoder_dpms; |
876 | bool ret; | 876 | bool ret; |
877 | 877 | ||
@@ -936,7 +936,7 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod | |||
936 | struct drm_framebuffer *old_fb) | 936 | struct drm_framebuffer *old_fb) |
937 | { | 937 | { |
938 | struct drm_crtc_state *crtc_state; | 938 | struct drm_crtc_state *crtc_state; |
939 | struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; | 939 | const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; |
940 | int ret; | 940 | int ret; |
941 | 941 | ||
942 | if (crtc->funcs->atomic_duplicate_state) | 942 | if (crtc->funcs->atomic_duplicate_state) |