aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_internal.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-09-09 14:21:30 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-09-09 15:05:17 +0200
commitfcc9021343212f6a4a52a085b3d383ab29a9ac0a (patch)
treee05a15bbc884458cac8d6454f0063893fb72920e /drivers/gpu/drm/drm_internal.h
parentdrm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL() (diff)
downloadlinux-dev-fcc9021343212f6a4a52a085b3d383ab29a9ac0a.tar.xz
linux-dev-fcc9021343212f6a4a52a085b3d383ab29a9ac0a.zip
drm: move drm_class into drm_sysfs.c
Right now, drm_sysfs_create() returns the newly allocated "struct class" to the caller (which is drm_core_init()), which then has to set the global variable 'drm_class'. During cleanup, though, we call drm_sysfs_destroy() which implicitly uses the global 'drm_class'. This is confusing, as ownership of the global 'drm_class' is non-obvious. This patch changes drm_sysfs_create() to drm_sysfs_init() and makes it initialize the 'drm_class' object directly, rather than returning it. This way, both drm_sysfs_init() and drm_sysfs_destroy() work in a similar fashion and manage the global drm class. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_internal.h')
-rw-r--r--drivers/gpu/drm/drm_internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
index 059af01bd07a..43cbda3306ac 100644
--- a/drivers/gpu/drm/drm_internal.h
+++ b/drivers/gpu/drm/drm_internal.h
@@ -73,7 +73,7 @@ int drm_authmagic(struct drm_device *dev, void *data,
/* drm_sysfs.c */
extern struct class *drm_class;
-struct class *drm_sysfs_create(struct module *owner, char *name);
+int drm_sysfs_init(void);
void drm_sysfs_destroy(void);
struct device *drm_sysfs_minor_alloc(struct drm_minor *minor);
int drm_sysfs_connector_add(struct drm_connector *connector);