Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/drm Clean up initialization f...
details: https://anonhg.NetBSD.org/src/rev/1f6080a980f8
branches: riastradh-drm2
changeset: 788599:1f6080a980f8
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jan 15 13:54:03 2014 +0000
description:
Clean up initialization failures in drm2_modcmd.
diffstat:
sys/external/bsd/drm2/drm/drm_module.c | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diffs (74 lines):
diff -r 112da75f3ffc -r 1f6080a980f8 sys/external/bsd/drm2/drm/drm_module.c
--- a/sys/external/bsd/drm2/drm/drm_module.c Wed Jan 15 13:53:53 2014 +0000
+++ b/sys/external/bsd/drm2/drm/drm_module.c Wed Jan 15 13:54:03 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_module.c,v 1.1.2.7 2013/12/30 04:50:12 riastradh Exp $ */
+/* $NetBSD: drm_module.c,v 1.1.2.8 2014/01/15 13:54:03 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.1.2.7 2013/12/30 04:50:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_module.c,v 1.1.2.8 2014/01/15 13:54:03 riastradh Exp $");
#include <sys/types.h>
#include <sys/device.h>
@@ -74,14 +74,13 @@
if (error) {
aprint_error("drm: unable to initialize linux kmap:"
" %d", error);
- return error;
+ goto init_fail0;
}
error = linux_workqueue_init();
if (error) {
aprint_error("drm: unable to initialize workqueues:"
" %d", error);
- linux_kmap_fini();
- return error;
+ goto init_fail1;
}
#ifdef _MODULE
error = config_init_component(cfdriver_ioconf_drm,
@@ -89,24 +88,30 @@
if (error) {
aprint_error("drm: unable to init component: %d\n",
error);
- linux_workqueue_fini();
- linux_kmap_fini();
- return error;
+ goto init_fail2;
}
error = devsw_attach("drm", NULL, &bmajor,
&drm_cdevsw, &cmajor);
if (error) {
aprint_error("drm: unable to attach devsw: %d\n",
error);
- (void)config_fini_component(cfdriver_ioconf_drm,
- cfattach_ioconf_drm, cfdata_ioconf_drm);
- linux_workqueue_fini();
- linux_kmap_fini();
- return error;
+ goto init_fail3;
}
#endif
return 0;
+#ifdef _MODULE
+#if 0
+init_fail4: (void)devsw_detach(NULL, &drm_cdevsw);
+#endif
+init_fail3: (void)config_fini_component(cfdriver_ioconf_drm,
+ cfattach_ioconf_drm, cfdata_ioconf_drm);
+init_fail2: linux_workqueue_fini();
+#endif /* _MODULE */
+init_fail1: linux_kmap_fini();
+init_fail0: linux_mutex_destroy(&drm_global_mutex);
+ return error;
+
case MODULE_CMD_FINI:
#ifdef _MODULE
error = devsw_detach(NULL, &drm_cdevsw);
Home |
Main Index |
Thread Index |
Old Index