[PATCH 2/5] drm/vgem: fops should be separate and constified

Ben Widawsky ben at bwidawsk.net
Wed Feb 8 15:19:28 PST 2012


...or else it just won't build.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/vgem/vgem_drv.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 82c6787..3084389 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -173,6 +173,16 @@ static struct drm_ioctl_desc vgem_ioctls[] = {
 			  DRM_UNLOCKED | DRM_AUTH),
 };
 
+static const struct file_operations vgem_driver_fops = {
+	.owner		= THIS_MODULE,
+	.open		= drm_open,
+	.mmap		= drm_gem_mmap,
+	.poll		= drm_poll,
+	.read		= drm_read,
+	.unlocked_ioctl = drm_ioctl,
+	.release	= drm_release,
+};
+
 static struct drm_driver vgem_driver = {
 	.driver_features	= DRIVER_BUS_PLATFORM | DRIVER_GEM,
 	.load			= vgem_load,
@@ -183,15 +193,7 @@ static struct drm_driver vgem_driver = {
 	.gem_free_object	= vgem_gem_free_object,
 	.gem_vm_ops		= &vgem_gem_vm_ops,
 	.ioctls			= vgem_ioctls,
-	.fops = {
-		.owner		= THIS_MODULE,
-		.open		= drm_open,
-		.mmap		= drm_gem_mmap,
-		.poll		= drm_poll,
-		.read		= drm_read,
-		.unlocked_ioctl = drm_ioctl,
-		.release	= drm_release,
-	},
+	.fops			= &vgem_driver_fops,
 	.name	= DRIVER_NAME,
 	.desc	= DRIVER_DESC,
 	.date	= DRIVER_DATE,
-- 
1.7.9



More information about the dri-devel mailing list