drm/sti: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Subsystems (3)
PATCH 1/1 drm/sti: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() function in place of the debugfs_create_file() function will make the file operation struct "reset" aware of the file's lifetime. Additional details here: https://lists.archive.carbon60.com/linux/kernel/2369498
Issue reported by Coccinelle script:scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
Signed-off-by Deepak R Varma <[email protected]>
---
Please Note: This is a Outreachy project task patch.
drivers/gpu/drm/sti/sti_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/sti/sti_drv.c +4 -4
@@ -68,8 +68,8 @@ static int sti_drm_fps_set(void *data, u64 val)return 0 ; } -DEFINE_SIMPLE_ATTRIBUTE (sti_drm_fps_fops, - sti_drm_fps_get, sti_drm_fps_set,"%llu\n" ); +DEFINE_DEBUGFS_ATTRIBUTE (sti_drm_fps_fops, sti_drm_fps_get, + sti_drm_fps_set,"%llu\n" );static int sti_drm_fps_dbg_show (struct seq_file *s,void *data) {
@@ -98,8 +98,8 @@ static void sti_drm_dbg_init(struct drm_minor *minor)ARRAY_SIZE (sti_drm_dbg_list), minor->debugfs_root, minor); -debugfs_create_file ("fps_show" ,S_IRUGO |S_IWUSR , minor->debugfs_root, - minor->dev, &sti_drm_fps_fops); +debugfs_create_file_unsafe ("fps_show" ,S_IRUGO |S_IWUSR , minor->debugfs_root, + minor->dev, &sti_drm_fps_fops);DRM_INFO ("%s: debugfs installed\n" ,DRIVER_NAME ); }
Signature · 1 line
2.25.1