projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'docs-4.9-2' of git://git.lwn.net/linux
[cascardo/linux.git]
/
drivers
/
gpu
/
drm
/
drm_drv.c
diff --git
a/drivers/gpu/drm/drm_drv.c
b/drivers/gpu/drm/drm_drv.c
index
acf6a5f
..
6efdba4
100644
(file)
--- a/
drivers/gpu/drm/drm_drv.c
+++ b/
drivers/gpu/drm/drm_drv.c
@@
-33,7
+33,6
@@
#include <linux/mount.h>
#include <linux/slab.h>
#include <drm/drmP.h>
#include <linux/mount.h>
#include <linux/slab.h>
#include <drm/drmP.h>
-#include <drm/drm_core.h>
#include "drm_crtc_internal.h"
#include "drm_legacy.h"
#include "drm_internal.h"
#include "drm_crtc_internal.h"
#include "drm_legacy.h"
#include "drm_internal.h"
@@
-46,8
+45,8
@@
unsigned int drm_debug = 0;
EXPORT_SYMBOL(drm_debug);
unsigned int drm_debug = 0;
EXPORT_SYMBOL(drm_debug);
-MODULE_AUTHOR(
CORE_AUTHOR
);
-MODULE_DESCRIPTION(
CORE_DESC
);
+MODULE_AUTHOR(
"Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl"
);
+MODULE_DESCRIPTION(
"DRM shared core routines"
);
MODULE_LICENSE("GPL and additional rights");
MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"
"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n"
MODULE_LICENSE("GPL and additional rights");
MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"
"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n"
@@
-90,7
+89,6
@@
void drm_dev_printk(const struct device *dev, const char *level,
EXPORT_SYMBOL(drm_dev_printk);
void drm_printk(const char *level, unsigned int category,
EXPORT_SYMBOL(drm_dev_printk);
void drm_printk(const char *level, unsigned int category,
- const char *function_name, const char *prefix,
const char *format, ...)
{
struct va_format vaf;
const char *format, ...)
{
struct va_format vaf;
@@
-103,7
+101,9
@@
void drm_printk(const char *level, unsigned int category,
vaf.fmt = format;
vaf.va = &args;
vaf.fmt = format;
vaf.va = &args;
- printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
+ printk("%s" "[" DRM_NAME ":%ps]%s %pV",
+ level, __builtin_return_address(0),
+ strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf);
va_end(args);
}
va_end(args);
}
@@
-339,6
+339,9
@@
void drm_minor_release(struct drm_minor *minor)
static int drm_dev_set_unique(struct drm_device *dev, const char *name)
{
static int drm_dev_set_unique(struct drm_device *dev, const char *name)
{
+ if (!name)
+ return -EINVAL;
+
kfree(dev->unique);
dev->unique = kstrdup(name, GFP_KERNEL);
kfree(dev->unique);
dev->unique = kstrdup(name, GFP_KERNEL);
@@
-589,7
+592,7
@@
EXPORT_SYMBOL(drm_dev_init);
* own struct should look at using drm_dev_init() instead.
*
* RETURNS:
* own struct should look at using drm_dev_init() instead.
*
* RETURNS:
- * Pointer to new DRM device, or
NULL if out of memory
.
+ * Pointer to new DRM device, or
ERR_PTR on failure
.
*/
struct drm_device *drm_dev_alloc(struct drm_driver *driver,
struct device *parent)
*/
struct drm_device *drm_dev_alloc(struct drm_driver *driver,
struct device *parent)
@@
-599,12
+602,12
@@
struct drm_device *drm_dev_alloc(struct drm_driver *driver,
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
- return
NULL
;
+ return
ERR_PTR(-ENOMEM)
;
ret = drm_dev_init(dev, driver, parent);
if (ret) {
kfree(dev);
ret = drm_dev_init(dev, driver, parent);
if (ret) {
kfree(dev);
- return
NULL
;
+ return
ERR_PTR(ret)
;
}
return dev;
}
return dev;
@@
-821,53
+824,48
@@
static const struct file_operations drm_stub_fops = {
.llseek = noop_llseek,
};
.llseek = noop_llseek,
};
+static void drm_core_exit(void)
+{
+ unregister_chrdev(DRM_MAJOR, "drm");
+ debugfs_remove(drm_debugfs_root);
+ drm_sysfs_destroy();
+ idr_destroy(&drm_minors_idr);
+ drm_connector_ida_destroy();
+ drm_global_release();
+}
+
static int __init drm_core_init(void)
{
static int __init drm_core_init(void)
{
- int ret
= -ENOMEM
;
+ int ret;
drm_global_init();
drm_connector_ida_init();
idr_init(&drm_minors_idr);
drm_global_init();
drm_connector_ida_init();
idr_init(&drm_minors_idr);
- if (register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops))
- goto err_p1;
-
ret = drm_sysfs_init();
if (ret < 0) {
ret = drm_sysfs_init();
if (ret < 0) {
-
printk(KERN_ERR "DRM: Error creating drm class.\n"
);
- goto err
_p2
;
+
DRM_ERROR("Cannot create DRM class: %d\n", ret
);
+ goto err
or
;
}
drm_debugfs_root = debugfs_create_dir("dri", NULL);
if (!drm_debugfs_root) {
}
drm_debugfs_root = debugfs_create_dir("dri", NULL);
if (!drm_debugfs_root) {
-
DRM_ERROR("Cannot create /sys/kernel/debug/dri\n")
;
-
ret = -1
;
- goto err
_p3
;
+
ret = -ENOMEM
;
+
DRM_ERROR("Cannot create debugfs-root: %d\n", ret)
;
+ goto err
or
;
}
}
- DRM_INFO("Initialized %s %d.%d.%d %s\n",
- CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
+ ret = register_chrdev(DRM_MAJOR, "drm", &drm_stub_fops);
+ if (ret < 0)
+ goto error;
+
+ DRM_INFO("Initialized\n");
return 0;
return 0;
-err_p3:
- drm_sysfs_destroy();
-err_p2:
- unregister_chrdev(DRM_MAJOR, "drm");
- idr_destroy(&drm_minors_idr);
-err_p1:
+error:
+ drm_core_exit();
return ret;
}
return ret;
}
-static void __exit drm_core_exit(void)
-{
- debugfs_remove(drm_debugfs_root);
- drm_sysfs_destroy();
-
- unregister_chrdev(DRM_MAJOR, "drm");
-
- drm_connector_ida_destroy();
- idr_destroy(&drm_minors_idr);
-}
-
module_init(drm_core_init);
module_exit(drm_core_exit);
module_init(drm_core_init);
module_exit(drm_core_exit);