diff options
author | Dave Airlie <airlied@linux.ie> | 2004-08-03 09:21:11 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2004-08-03 09:21:11 +0000 |
commit | 4f8f02a1922653b2ce5c115c4469e927b5d826fa (patch) | |
tree | 852e78d7a2cedbf52e564c44b7c282fe2c588343 /linux-core/drm_proc.c | |
parent | 33b740ad9946ce6fdedeed45287e488f95fb7b42 (diff) |
fix for drm in /proc - from Jon Smirl
Diffstat (limited to 'linux-core/drm_proc.c')
-rw-r--r-- | linux-core/drm_proc.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c index dc6e1bb2..a9affc5a 100644 --- a/linux-core/drm_proc.c +++ b/linux-core/drm_proc.c @@ -87,7 +87,7 @@ struct drm_proc_list { * "/proc/dri/%minor%/", and each entry in proc_list as * "/proc/dri/%minor%/%name%". */ -struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor, +int DRM(proc_init)(drm_device_t *dev, int minor, struct proc_dir_entry *root, struct proc_dir_entry **dev_root) { @@ -95,17 +95,11 @@ struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor, int i, j; char name[64]; - if (!minor) root = create_proc_entry("dri", S_IFDIR, NULL); - if (!root) { - DRM_ERROR("Cannot create /proc/dri\n"); - return NULL; - } - sprintf(name, "%d", minor); *dev_root = create_proc_entry(name, S_IFDIR, root); if (!*dev_root) { DRM_ERROR("Cannot create /proc/dri/%s\n", name); - return NULL; + return -1; } for (i = 0; i < DRM_PROC_ENTRIES; i++) { @@ -118,14 +112,12 @@ struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor, remove_proc_entry(DRM(proc_list)[i].name, *dev_root); remove_proc_entry(name, root); - if (!minor) remove_proc_entry("dri", NULL); - return NULL; + return -1; } ent->read_proc = DRM(proc_list)[i].f; ent->data = dev; } - - return root; + return 0; } @@ -151,7 +143,6 @@ int DRM(proc_cleanup)(int minor, struct proc_dir_entry *root, remove_proc_entry(DRM(proc_list)[i].name, dev_root); sprintf(name, "%d", minor); remove_proc_entry(name, root); - if (!minor) remove_proc_entry("dri", NULL); return 0; } |