More err path clean up for drm_pm Add mandatory sysdev shutdown function
parent
fe42d43a63
commit
5b0e93de32
|
@ -339,7 +339,6 @@ int drm_init(struct drm_driver *driver,
|
|||
if (!drm_fb_loaded)
|
||||
pci_register_driver(&driver->pci_driver);
|
||||
else {
|
||||
drm_pm_init();
|
||||
for (i = 0; pciidlist[i].vendor != 0; i++) {
|
||||
pid = &pciidlist[i];
|
||||
|
||||
|
@ -516,12 +515,17 @@ static int __init drm_core_init(void)
|
|||
goto err_p3;
|
||||
}
|
||||
|
||||
if ((ret = drm_pm_init()))
|
||||
goto err_p4;
|
||||
|
||||
drm_mem_init();
|
||||
|
||||
DRM_INFO("Initialized %s %d.%d.%d %s\n",
|
||||
CORE_NAME,
|
||||
CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
|
||||
return 0;
|
||||
err_p4:
|
||||
remove_proc_entry("dri", NULL);
|
||||
err_p3:
|
||||
drm_sysfs_destroy(drm_class);
|
||||
err_p2:
|
||||
|
|
|
@ -62,11 +62,16 @@ static int drm_resume(struct sys_device *sysdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int drm_sysdev_class_registered = 0;
|
||||
static int shutdown(struct sys_device *sysdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct sysdev_class drm_sysdev_class = {
|
||||
set_kset_name("drm"),
|
||||
.resume = drm_resume,
|
||||
.suspend = drm_suspend,
|
||||
.shutdown = shutdown,
|
||||
};
|
||||
|
||||
|
||||
|
@ -115,17 +120,12 @@ void drm_pm_takedown(drm_device_t *dev)
|
|||
|
||||
int drm_pm_init(void)
|
||||
{
|
||||
int rc;
|
||||
DRM_DEBUG("\n");
|
||||
rc = sysdev_class_register(&drm_sysdev_class);
|
||||
if (!rc)
|
||||
drm_sysdev_class_registered = 1;
|
||||
return rc;
|
||||
return sysdev_class_register(&drm_sysdev_class);
|
||||
}
|
||||
|
||||
void drm_pm_exit(void)
|
||||
void __exit drm_pm_exit(void)
|
||||
{
|
||||
DRM_DEBUG("\n");
|
||||
if (drm_sysdev_class_registered)
|
||||
sysdev_class_unregister(&drm_sysdev_class);
|
||||
sysdev_class_unregister(&drm_sysdev_class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue