Skip to content

Commit

Permalink
drm: Constify drm_mode_config_funcs pointer
Browse files Browse the repository at this point in the history
The DRM mode config functions structure declared by drivers and pointed
to by the drm_mode_config funcs field is never modified. Make it a const
pointer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Inki Dae <inki.dae@samsung.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Rob Clark <rob.clark@linaro.org>
Reviwed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Dave Airlie committed May 22, 2012
1 parent 78b6855 commit e6ecefa
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void exynos_drm_output_poll_changed(struct drm_device *dev)
drm_fb_helper_hotplug_event(fb_helper);
}

static struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
.fb_create = exynos_user_fb_create,
.output_poll_changed = exynos_drm_output_poll_changed,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/gma500/framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ void psb_modeset_init(struct drm_device *dev)
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;

dev->mode_config.funcs = (void *) &psb_mode_funcs;
dev->mode_config.funcs = &psb_mode_funcs;

/* set memory base */
/* Oaktrail and Poulsbo should use BAR 2*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -6941,7 +6941,7 @@ void intel_modeset_init(struct drm_device *dev)
dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow = 1;

dev->mode_config.funcs = (void *)&intel_mode_funcs;
dev->mode_config.funcs = &intel_mode_funcs;

intel_init_quirks(dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ nouveau_display_create(struct drm_device *dev)
disp->color_vibrance_property->values[1] = 200; /* -100..+100 */
}

dev->mode_config.funcs = (void *)&nouveau_mode_config_funcs;
dev->mode_config.funcs = &nouveau_mode_config_funcs;
dev->mode_config.fb_base = pci_resource_start(dev->pdev, 1);

dev->mode_config.min_width = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ int radeon_modeset_init(struct radeon_device *rdev)
drm_mode_config_init(rdev->ddev);
rdev->mode_info.mode_config_initialized = true;

rdev->ddev->mode_config.funcs = (void *)&radeon_mode_funcs;
rdev->ddev->mode_config.funcs = &radeon_mode_funcs;

if (ASIC_IS_DCE5(rdev)) {
rdev->ddev->mode_config.max_width = 16384;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/udl/udl_modeset.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ int udl_modeset_init(struct drm_device *dev)
dev->mode_config.prefer_shadow = 0;
dev->mode_config.preferred_depth = 24;

dev->mode_config.funcs = (void *)&udl_mode_funcs;
dev->mode_config.funcs = &udl_mode_funcs;

drm_mode_create_dirty_info_property(dev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
return &vfb->base;
}

static struct drm_mode_config_funcs vmw_kms_funcs = {
static const struct drm_mode_config_funcs vmw_kms_funcs = {
.fb_create = vmw_kms_fb_create,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void omap_fb_output_poll_changed(struct drm_device *dev)
}
}

static struct drm_mode_config_funcs omap_mode_config_funcs = {
static const struct drm_mode_config_funcs omap_mode_config_funcs = {
.fb_create = omap_framebuffer_create,
.output_poll_changed = omap_fb_output_poll_changed,
};
Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ struct drm_mode_config {

int min_width, min_height;
int max_width, max_height;
struct drm_mode_config_funcs *funcs;
const struct drm_mode_config_funcs *funcs;
resource_size_t fb_base;

/* output poll support */
Expand Down

0 comments on commit e6ecefa

Please sign in to comment.