X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fgpu%2Fdrm%2Fdrm_sysfs.c;h=5de573a981cb19d5da7789270bfd0b05bdf8006f;hb=90f959bcb386da2c71613dcefc6a285e054a539e;hp=186d08159d4871560291e8cf8eccfffd6ebcfa0e;hpb=01e6de64d9c8d0e75dca3bb4cf898db73abe00d4;p=linux-2.6-omap-h63xx.git diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 186d08159d4..5de573a981c 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -35,7 +35,9 @@ static int drm_sysfs_suspend(struct device *dev, pm_message_t state) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && drm_dev->driver->suspend) + if (drm_minor->type == DRM_MINOR_LEGACY && + !drm_core_check_feature(drm_dev, DRIVER_MODESET) && + drm_dev->driver->suspend) return drm_dev->driver->suspend(drm_dev, state); return 0; @@ -53,7 +55,9 @@ static int drm_sysfs_resume(struct device *dev) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && drm_dev->driver->resume) + if (drm_minor->type == DRM_MINOR_LEGACY && + !drm_core_check_feature(drm_dev, DRIVER_MODESET) && + drm_dev->driver->resume) return drm_dev->driver->resume(drm_dev); return 0; @@ -118,20 +122,6 @@ void drm_sysfs_destroy(void) class_destroy(drm_class); } -static ssize_t show_dri(struct device *device, struct device_attribute *attr, - char *buf) -{ - struct drm_minor *drm_minor = to_drm_minor(device); - struct drm_device *drm_dev = drm_minor->dev; - if (drm_dev->driver->dri_library_name) - return drm_dev->driver->dri_library_name(drm_dev, buf); - return snprintf(buf, PAGE_SIZE, "%s\n", drm_dev->driver->pci_driver.name); -} - -static struct device_attribute device_attrs[] = { - __ATTR(dri_library_name, S_IRUGO, show_dri, NULL), -}; - /** * drm_sysfs_device_release - do nothing * @dev: Linux device @@ -474,7 +464,6 @@ void drm_sysfs_hotplug_event(struct drm_device *dev) int drm_sysfs_device_add(struct drm_minor *minor) { int err; - int i, j; char *minor_str; minor->kdev.parent = &minor->dev->pdev->dev; @@ -496,18 +485,8 @@ int drm_sysfs_device_add(struct drm_minor *minor) goto err_out; } - for (i = 0; i < ARRAY_SIZE(device_attrs); i++) { - err = device_create_file(&minor->kdev, &device_attrs[i]); - if (err) - goto err_out_files; - } - return 0; -err_out_files: - if (i > 0) - for (j = 0; j < i; j++) - device_remove_file(&minor->kdev, &device_attrs[j]); device_unregister(&minor->kdev); err_out: @@ -523,9 +502,5 @@ err_out: */ void drm_sysfs_device_remove(struct drm_minor *minor) { - int i; - - for (i = 0; i < ARRAY_SIZE(device_attrs); i++) - device_remove_file(&minor->kdev, &device_attrs[i]); device_unregister(&minor->kdev); }