aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_sysfs.c25
-rw-r--r--include/drm/drm_sysfs.h12
2 files changed, 37 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index adc179459c25..de154556c405 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -16,6 +16,7 @@
16#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
17#include <linux/err.h> 17#include <linux/err.h>
18 18
19#include "drm_sysfs.h"
19#include "drm_core.h" 20#include "drm_core.h"
20#include "drmP.h" 21#include "drmP.h"
21 22
@@ -515,3 +516,27 @@ void drm_sysfs_device_remove(struct drm_minor *minor)
515{ 516{
516 device_unregister(&minor->kdev); 517 device_unregister(&minor->kdev);
517} 518}
519
520
521/**
522 * drm_class_device_register - Register a struct device in the drm class.
523 *
524 * @dev: pointer to struct device to register.
525 *
526 * @dev should have all relevant members pre-filled with the exception
527 * of the class member. In particular, the device_type member must
528 * be set.
529 */
530
531int drm_class_device_register(struct device *dev)
532{
533 dev->class = drm_class;
534 return device_register(dev);
535}
536EXPORT_SYMBOL_GPL(drm_class_device_register);
537
538void drm_class_device_unregister(struct device *dev)
539{
540 return device_unregister(dev);
541}
542EXPORT_SYMBOL_GPL(drm_class_device_unregister);
diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
new file mode 100644
index 000000000000..1d8e033fde67
--- /dev/null
+++ b/include/drm/drm_sysfs.h
@@ -0,0 +1,12 @@
1#ifndef _DRM_SYSFS_H_
2#define _DRM_SYSFS_H_
3
4/**
5 * This minimalistic include file is intended for users (read TTM) that
6 * don't want to include the full drmP.h file.
7 */
8
9extern int drm_class_device_register(struct device *dev);
10extern void drm_class_device_unregister(struct device *dev);
11
12#endif