summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_proc.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2009-08-28 20:58:07 +0200
committerDave Airlie <airlied@redhat.com>2009-08-31 01:37:22 +0200
commit3b51096f95633e6ab47675984e8e38fc37b09eeb (patch)
treebc47fe5890b7d1419943645071b19e45719e5fb5 /drivers/gpu/drm/drm_proc.c
parentdrm/kms: Parse the detailed time info in CEA-EDID (diff)
downloadlinux-3b51096f95633e6ab47675984e8e38fc37b09eeb.tar.xz
linux-3b51096f95633e6ab47675984e8e38fc37b09eeb.zip
drm: use proc_create_data()
airlied: fixup race against drm info by filling out tmp before adding it to proc. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_proc.c')
-rw-r--r--drivers/gpu/drm/drm_proc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index dc967af7a33c..d379c4f2892f 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -110,20 +110,21 @@ int drm_proc_create_files(struct drm_info_list *files, int count,
ret = -1;
goto fail;
}
- ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root);
+ tmp->minor = minor;
+ tmp->info_ent = &files[i];
+ list_add(&tmp->list, &minor->proc_nodes.list);
+
+ ent = proc_create_data(files[i].name, S_IRUGO, root,
+ &drm_proc_fops, tmp);
if (!ent) {
DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
name, files[i].name);
+ list_del(&tmp->list);
kfree(tmp);
ret = -1;
goto fail;
}
- ent->proc_fops = &drm_proc_fops;
- ent->data = tmp;
- tmp->minor = minor;
- tmp->info_ent = &files[i];
- list_add(&(tmp->list), &(minor->proc_nodes.list));
}
return 0;