aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_file.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-05-08 10:26:33 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-05-09 13:22:11 +0200
commit45c3d213a400c952ab7119f394c5293bb6877e6b (patch)
tree7b974913b9fdb3e430b5c2bd0c11c3aac7e9b168 /drivers/gpu/drm/drm_file.c
parentdrm/exynos: Merge pre/postclose hooks (diff)
downloadlinux-dev-45c3d213a400c952ab7119f394c5293bb6877e6b.tar.xz
linux-dev-45c3d213a400c952ab7119f394c5293bb6877e6b.zip
drm: Nerf the preclose callback for modern drivers
With all drivers converted there's only legacy dri1 drivers using it. Not going to touch those, instead just hide it like we've done with other dri1 driver hooks like firstopen. In all this I didn't find any real reason why we'd needed 2 hooks, and having symmetry between open and close just appeases my OCD better. Yeah, someone else could do an s/postclose/close/, but that's for someone who understands cocci. And maybe after this series is reviewed and landed, to avoid patch-regen churn. v2: s/last/post/close in the kernel-doc (Sean). Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170508082633.4214-4-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_file.c')
-rw-r--r--drivers/gpu/drm/drm_file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 3783b659cd38..caad93dab54b 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -351,9 +351,8 @@ void drm_lastclose(struct drm_device * dev)
*
* This function must be used by drivers as their &file_operations.release
* method. It frees any resources associated with the open file, and calls the
- * &drm_driver.preclose and &drm_driver.lastclose driver callbacks. If this is
- * the last open file for the DRM device also proceeds to call the
- * &drm_driver.lastclose driver callback.
+ * &drm_driver.postclose driver callback. If this is the last open file for the
+ * DRM device also proceeds to call the &drm_driver.lastclose driver callback.
*
* RETURNS:
*
@@ -373,7 +372,8 @@ int drm_release(struct inode *inode, struct file *filp)
list_del(&file_priv->lhead);
mutex_unlock(&dev->filelist_mutex);
- if (dev->driver->preclose)
+ if (drm_core_check_feature(dev, DRIVER_LEGACY) &&
+ dev->driver->preclose)
dev->driver->preclose(dev, file_priv);
/* ========================================================