@@ -671,6 +671,11 @@ EXPORT_SYMBOL(drm_dev_unref);
int drm_dev_register(struct drm_device *dev, unsigned long flags)
{
int ret;
+ struct dentry *drmfs_root;
+
+ drmfs_root = drmfs_create_dir(dev->driver->name, NULL);
+ if (!IS_ERR(drmfs_root))
+ dev->driver->drmfs_root = drmfs_root;
mutex_lock(&drm_global_mutex);
@@ -742,6 +747,7 @@ void drm_dev_unregister(struct drm_device *dev)
drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
drm_minor_unregister(dev, DRM_MINOR_RENDER);
drm_minor_unregister(dev, DRM_MINOR_CONTROL);
+ drmfs_remove(dev->driver->drmfs_root);
}
EXPORT_SYMBOL(drm_dev_unregister);
@@ -405,6 +405,9 @@ struct drm_driver {
/* List of devices hanging off this driver with stealth attach. */
struct list_head legacy_dev_list;
+
+ /* drmfs parent directory dentry for this driver */
+ struct dentry *drmfs_root;
};
extern __printf(6, 7)