aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_sysfs.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-01-05 16:10:05 -0500
committerDave Airlie <airlied@redhat.com>2009-03-13 00:23:58 -0400
commit8e1004580e0c862cb6bbe2ff8e496f846c54052f (patch)
treef75ca2cebf77d2746613af8e5b61998057df5387 /drivers/gpu/drm/drm_sysfs.c
parent112b715e8e2f9ef7b96930888bb099ce10b4c3cc (diff)
drm: Drop unused and broken dri_library_name sysfs attribute.
The kernel shouldn't be in the business of telling user space which driver to load. The kernel defers mapping PCI IDs to module names to user space and we should do the same for DRI drivers. And in fact, that's how it does work today. Nothing uses the dri_library_name attribute, and the attribute is in fact broken. For intel devices, it falls back to the default behaviour of returning the kernel module name as the DRI driver name, which doesn't work for i965 devices. Nobody has ever hit this problem or filed a bug about this. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_sysfs.c')
-rw-r--r--drivers/gpu/drm/drm_sysfs.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 480546b542fe..f7510a8f0eb9 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -122,20 +122,6 @@ void drm_sysfs_destroy(void)
122 class_destroy(drm_class); 122 class_destroy(drm_class);
123} 123}
124 124
125static ssize_t show_dri(struct device *device, struct device_attribute *attr,
126 char *buf)
127{
128 struct drm_minor *drm_minor = to_drm_minor(device);
129 struct drm_device *drm_dev = drm_minor->dev;
130 if (drm_dev->driver->dri_library_name)
131 return drm_dev->driver->dri_library_name(drm_dev, buf);
132 return snprintf(buf, PAGE_SIZE, "%s\n", drm_dev->driver->pci_driver.name);
133}
134
135static struct device_attribute device_attrs[] = {
136 __ATTR(dri_library_name, S_IRUGO, show_dri, NULL),
137};
138
139/** 125/**
140 * drm_sysfs_device_release - do nothing 126 * drm_sysfs_device_release - do nothing
141 * @dev: Linux device 127 * @dev: Linux device
@@ -478,7 +464,6 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
478int drm_sysfs_device_add(struct drm_minor *minor) 464int drm_sysfs_device_add(struct drm_minor *minor)
479{ 465{
480 int err; 466 int err;
481 int i, j;
482 char *minor_str; 467 char *minor_str;
483 468
484 minor->kdev.parent = &minor->dev->pdev->dev; 469 minor->kdev.parent = &minor->dev->pdev->dev;
@@ -500,18 +485,8 @@ int drm_sysfs_device_add(struct drm_minor *minor)
500 goto err_out; 485 goto err_out;
501 } 486 }
502 487
503 for (i = 0; i < ARRAY_SIZE(device_attrs); i++) {
504 err = device_create_file(&minor->kdev, &device_attrs[i]);
505 if (err)
506 goto err_out_files;
507 }
508
509 return 0; 488 return 0;
510 489
511err_out_files:
512 if (i > 0)
513 for (j = 0; j < i; j++)
514 device_remove_file(&minor->kdev, &device_attrs[j]);
515 device_unregister(&minor->kdev); 490 device_unregister(&minor->kdev);
516err_out: 491err_out:
517 492
@@ -527,9 +502,5 @@ err_out:
527 */ 502 */
528void drm_sysfs_device_remove(struct drm_minor *minor) 503void drm_sysfs_device_remove(struct drm_minor *minor)
529{ 504{
530 int i;
531
532 for (i = 0; i < ARRAY_SIZE(device_attrs); i++)
533 device_remove_file(&minor->kdev, &device_attrs[i]);
534 device_unregister(&minor->kdev); 505 device_unregister(&minor->kdev);
535} 506}