summaryrefslogtreecommitdiff
path: root/sys/dev/clockctl.c
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-28 12:33:20 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-28 12:33:20 +0000
commitad9f158865c014cbf7b944e84da320cd15c6a441 (patch)
tree9ea1555d3af729ad52b7051933f66dc3b21c7525 /sys/dev/clockctl.c
parent68478a546548d97b8d1c10bb8affd59ea7d8c44c (diff)
driver(9): devsw_detach never fails. Make it return void.
Prune a whole lotta dead branches as a result of this. (Some logic calling this is also wrong for other reasons; devsw_detach is final -- you should never have any reason to decide to roll it back. To be cleaned up in subsequent commits...) XXX kernel ABI change to devsw_detach signature requires bump
Diffstat (limited to 'sys/dev/clockctl.c')
-rw-r--r--sys/dev/clockctl.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/clockctl.c b/sys/dev/clockctl.c
index 0da5e7765fe..e3b33816586 100644
--- a/sys/dev/clockctl.c
+++ b/sys/dev/clockctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: clockctl.c,v 1.38 2020/02/21 00:26:22 joerg Exp $ */
+/* $NetBSD: clockctl.c,v 1.39 2022/03/28 12:33:20 riastradh Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.38 2020/02/21 00:26:22 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clockctl.c,v 1.39 2022/03/28 12:33:20 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_ntp.h"
@@ -182,14 +182,12 @@ clockctl_modcmd(modcmd_t cmd, void *data)
return EBUSY;
}
#ifdef _MODULE
- error = devsw_detach(NULL, &clockctl_cdevsw);
+ devsw_detach(NULL, &clockctl_cdevsw);
#endif
mutex_exit(&clockctl_mtx);
- if (error == 0) {
- kauth_unlisten_scope(clockctl_listener);
- mutex_destroy(&clockctl_mtx);
- }
+ kauth_unlisten_scope(clockctl_listener);
+ mutex_destroy(&clockctl_mtx);
break;
default: