drm: Constify gem_vm_ops pointer
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 17 May 2012 11:27:22 +0000 (13:27 +0200)
committerDave Airlie <airlied@redhat.com>
Tue, 22 May 2012 09:34:53 +0000 (10:34 +0100)
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>
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/gma500/framebuffer.c
drivers/gpu/drm/gma500/psb_drv.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/udl/udl_drv.c
drivers/staging/omapdrm/omap_drv.c
include/drm/drmP.h

index a6819b5f8428f4edf6af24420f0ffb784cb24641..67a67b0839afcbf8ba3acc7e38bdb30ebe59820e 100644 (file)
@@ -193,7 +193,7 @@ static void exynos_drm_lastclose(struct drm_device *dev)
        exynos_drm_fbdev_restore_mode(dev);
 }
 
-static struct vm_operations_struct exynos_drm_gem_vm_ops = {
+static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
        .fault = exynos_drm_gem_fault,
        .open = drm_gem_vm_open,
        .close = drm_gem_vm_close,
index 8d77224afc3422521048a311fc3fe9af6844ef89..09cd23cc05a84d4cd6f1ef8b30137e581bdde06d 100644 (file)
@@ -153,7 +153,7 @@ static void psbfb_vm_close(struct vm_area_struct *vma)
 {
 }
 
-static struct vm_operations_struct psbfb_vm_ops = {
+static const struct vm_operations_struct psbfb_vm_ops = {
        .fault  = psbfb_vm_fault,
        .open   = psbfb_vm_open,
        .close  = psbfb_vm_close
index 0c995ba0f2ec393d32251f62b6c7efb56a6288d4..caba6e08693cb83119f3f22e32ba8f14e1b4fbdd 100644 (file)
@@ -595,7 +595,7 @@ static const struct dev_pm_ops psb_pm_ops = {
        .runtime_idle = psb_runtime_idle,
 };
 
-static struct vm_operations_struct psb_gem_vm_ops = {
+static const struct vm_operations_struct psb_gem_vm_ops = {
        .fault = psb_gem_fault,
        .open = drm_gem_vm_open,
        .close = drm_gem_vm_close,
index d3e1948530614c4d5dc48854f8d3aa719a0ac9c7..7b967d5bf51d5998d1b9cca8284a0a8c912c8c2c 100644 (file)
@@ -1012,7 +1012,7 @@ static const struct dev_pm_ops i915_pm_ops = {
        .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 53673907a6a0d93cf9367b62fdad247939bc70d3..82e6921e686550fbc90b05bf9ff0391fb8c050f2 100644 (file)
@@ -38,7 +38,7 @@ static void udl_usb_disconnect(struct usb_interface *interface)
        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 620b8d54223d987f00dbf421fa7d0b34a25451d1..071c7702d05df40726f2856981177760234fded8 100644 (file)
@@ -726,7 +726,7 @@ static void dev_irq_uninstall(struct drm_device *dev)
        DBG("irq_uninstall: dev=%p", dev);
 }
 
-static struct vm_operations_struct omap_gem_vm_ops = {
+static const struct vm_operations_struct omap_gem_vm_ops = {
        .fault = omap_gem_fault,
        .open = drm_gem_vm_open,
        .close = drm_gem_vm_close,
index e14a77c4e56bc1b1c612a963734e14b841ee5994..15d91798dd313eda5a481d80ca79b4de9dd2fb35 100644 (file)
@@ -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;