drm/nouveau: constify all struct drm_*_helper funcs pointers
authorJani Nikula <jani.nikula@intel.com>
Wed, 11 Mar 2015 09:51:04 +0000 (11:51 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 7 Apr 2015 16:11:24 +0000 (18:11 +0200)
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>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/nouveau/dispnv04/crtc.c
drivers/gpu/drm/nouveau/dispnv04/dac.c
drivers/gpu/drm/nouveau/dispnv04/dfp.c
drivers/gpu/drm/nouveau/dispnv04/disp.c
drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
drivers/gpu/drm/nouveau/nouveau_connector.c

index 542bb26..3d96b49 100644 (file)
@@ -703,7 +703,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
        struct drm_device *dev = crtc->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
-       struct drm_crtc_helper_funcs *funcs = crtc->helper_private;
+       const struct drm_crtc_helper_funcs *funcs = crtc->helper_private;
 
        if (nv_two_heads(dev))
                NVSetOwner(dev, nv_crtc->index);
@@ -724,7 +724,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
 static void nv_crtc_commit(struct drm_crtc *crtc)
 {
        struct drm_device *dev = crtc->dev;
-       struct drm_crtc_helper_funcs *funcs = crtc->helper_private;
+       const struct drm_crtc_helper_funcs *funcs = crtc->helper_private;
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
 
        nouveau_hw_load_state(dev, nv_crtc->index, &nv04_display(dev)->mode_reg);
index d7b495a..af7249c 100644 (file)
@@ -358,7 +358,7 @@ static bool nv04_dac_mode_fixup(struct drm_encoder *encoder,
 
 static void nv04_dac_prepare(struct drm_encoder *encoder)
 {
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
        struct drm_device *dev = encoder->dev;
        int head = nouveau_crtc(encoder->crtc)->index;
 
@@ -409,7 +409,7 @@ static void nv04_dac_commit(struct drm_encoder *encoder)
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
        struct nouveau_drm *drm = nouveau_drm(encoder->dev);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
 
        helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
index f6ca343..7cfb0cb 100644 (file)
@@ -244,7 +244,7 @@ static void nv04_dfp_prepare_sel_clk(struct drm_device *dev,
 static void nv04_dfp_prepare(struct drm_encoder *encoder)
 {
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
        struct drm_device *dev = encoder->dev;
        int head = nouveau_crtc(encoder->crtc)->index;
        struct nv04_crtc_reg *crtcstate = nv04_display(dev)->mode_reg.crtc_reg;
@@ -445,7 +445,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder)
 {
        struct drm_device *dev = encoder->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
        struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
        struct dcb_output *dcbe = nv_encoder->dcb;
index f96237e..4131be5 100644 (file)
@@ -109,7 +109,7 @@ nv04_display_create(struct drm_device *dev)
                crtc->funcs->save(crtc);
 
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               struct drm_encoder_helper_funcs *func = encoder->helper_private;
+               const struct drm_encoder_helper_funcs *func = encoder->helper_private;
 
                func->save(encoder);
        }
@@ -138,7 +138,7 @@ nv04_display_destroy(struct drm_device *dev)
 
        /* Restore state */
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               struct drm_encoder_helper_funcs *func = encoder->helper_private;
+               const struct drm_encoder_helper_funcs *func = encoder->helper_private;
 
                func->restore(encoder);
        }
@@ -169,7 +169,7 @@ nv04_display_init(struct drm_device *dev)
         * on suspend too.
         */
        list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
-               struct drm_encoder_helper_funcs *func = encoder->helper_private;
+               const struct drm_encoder_helper_funcs *func = encoder->helper_private;
 
                func->restore(encoder);
        }
index d9664b3..70e95cf 100644 (file)
@@ -122,7 +122,7 @@ static void nv04_tv_prepare(struct drm_encoder *encoder)
 {
        struct drm_device *dev = encoder->dev;
        int head = nouveau_crtc(encoder->crtc)->index;
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
 
        helper->dpms(encoder, DRM_MODE_DPMS_OFF);
 
@@ -164,7 +164,7 @@ static void nv04_tv_commit(struct drm_encoder *encoder)
        struct drm_device *dev = encoder->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
 
        helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
index 731d74e..d9720dd 100644 (file)
@@ -405,7 +405,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder)
 {
        struct drm_device *dev = encoder->dev;
        struct nouveau_drm *drm = nouveau_drm(dev);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
        struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder);
        int head = nouveau_crtc(encoder->crtc)->index;
        uint8_t *cr_lcd = &nv04_display(dev)->mode_reg.crtc_reg[head].CRTC[
@@ -583,7 +583,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder)
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
-       struct drm_encoder_helper_funcs *helper = encoder->helper_private;
+       const struct drm_encoder_helper_funcs *helper = encoder->helper_private;
 
        if (get_tv_norm(encoder)->kind == TV_ENC_MODE) {
                nv17_tv_update_rescaler(encoder);