aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_sysfs.c')
-rw-r--r--drivers/gpu/drm/drm_sysfs.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 7e42b7e9d43a..014ce24761b9 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -70,19 +70,17 @@ static int drm_class_resume(struct device *dev)
70 return 0; 70 return 0;
71} 71}
72 72
73/* Display the version of drm_core. This doesn't work right in current design */
74static ssize_t version_show(struct class *dev, char *buf)
75{
76 return sprintf(buf, "%s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR,
77 CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
78}
79
80static char *drm_devnode(struct device *dev, mode_t *mode) 73static char *drm_devnode(struct device *dev, mode_t *mode)
81{ 74{
82 return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); 75 return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
83} 76}
84 77
85static CLASS_ATTR(version, S_IRUGO, version_show, NULL); 78static CLASS_ATTR_STRING(version, S_IRUGO,
79 CORE_NAME " "
80 __stringify(CORE_MAJOR) "."
81 __stringify(CORE_MINOR) "."
82 __stringify(CORE_PATCHLEVEL) " "
83 CORE_DATE);
86 84
87/** 85/**
88 * drm_sysfs_create - create a struct drm_sysfs_class structure 86 * drm_sysfs_create - create a struct drm_sysfs_class structure
@@ -109,7 +107,7 @@ struct class *drm_sysfs_create(struct module *owner, char *name)
109 class->suspend = drm_class_suspend; 107 class->suspend = drm_class_suspend;
110 class->resume = drm_class_resume; 108 class->resume = drm_class_resume;
111 109
112 err = class_create_file(class, &class_attr_version); 110 err = class_create_file(class, &class_attr_version.attr);
113 if (err) 111 if (err)
114 goto err_out_class; 112 goto err_out_class;
115 113
@@ -132,7 +130,7 @@ void drm_sysfs_destroy(void)
132{ 130{
133 if ((drm_class == NULL) || (IS_ERR(drm_class))) 131 if ((drm_class == NULL) || (IS_ERR(drm_class)))
134 return; 132 return;
135 class_remove_file(drm_class, &class_attr_version); 133 class_remove_file(drm_class, &class_attr_version.attr);
136 class_destroy(drm_class); 134 class_destroy(drm_class);
137} 135}
138 136