From 78b68556a964e74fb803b08c5b2d9c6ba3ec3787 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Thu, 17 May 2012 13:27:22 +0200
Subject: drm: Constify gem_vm_ops pointer
Git-commit: 78b68556a964e74fb803b08c5b2d9c6ba3ec3787
Patch-mainline: v3.5-rc1

The GEM vm operations structure is passed to the VM core that stores it
in a const field. There vm operations structures can thus be const in
DRM as well.

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: Rob Clark <rob.clark@linaro.org>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Acked-by: Michal Srb <msrb@suse.com>
---
 drivers/gpu/drm/gma500/framebuffer.c    |    2 +-
 drivers/gpu/drm/gma500/psb_drv.c        |    2 +-
 drivers/gpu/drm/i915/i915_drv.c         |    2 +-
 drivers/gpu/drm/udl/udl_drv.c           |    2 +-
 drivers/staging/omapdrm/omap_drv.c      |    2 +-
 include/drm/drmP.h                      |    2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

Index: linux-3.0-SLE11-SP3/drivers/gpu/drm/i915/i915_drv.c
===================================================================
--- linux-3.0-SLE11-SP3.orig/drivers/gpu/drm/i915/i915_drv.c
+++ linux-3.0-SLE11-SP3/drivers/gpu/drm/i915/i915_drv.c
@@ -1012,7 +1012,7 @@ static const struct dev_pm_ops i915_pm_o
 	.restore = i915_pm_resume,
 };
 
-static struct vm_operations_struct i915_gem_vm_ops = {
+static const struct vm_operations_struct i915_gem_vm_ops = {
 	.fault = i915_gem_fault,
 	.open = drm_gem_vm_open,
 	.close = drm_gem_vm_close,
Index: linux-3.0-SLE11-SP3/drivers/gpu/drm/udl/udl_drv.c
===================================================================
--- linux-3.0-SLE11-SP3.orig/drivers/gpu/drm/udl/udl_drv.c
+++ linux-3.0-SLE11-SP3/drivers/gpu/drm/udl/udl_drv.c
@@ -38,7 +38,7 @@ static void udl_usb_disconnect(struct us
 	drm_unplug_dev(dev);
 }
 
-static struct vm_operations_struct udl_gem_vm_ops = {
+static const struct vm_operations_struct udl_gem_vm_ops = {
 	.fault = udl_gem_fault,
 	.open = drm_gem_vm_open,
 	.close = drm_gem_vm_close,
Index: linux-3.0-SLE11-SP3/include/drm/drmP.h
===================================================================
--- linux-3.0-SLE11-SP3.orig/include/drm/drmP.h
+++ linux-3.0-SLE11-SP3/include/drm/drmP.h
@@ -941,7 +941,7 @@ struct drm_driver {
 			    uint32_t handle);
 
 	/* Driver private ops for this object */
-	struct vm_operations_struct *gem_vm_ops;
+	const struct vm_operations_struct *gem_vm_ops;
 
 	int major;
 	int minor;
