From ad9f158865c014cbf7b944e84da320cd15c6a441 Mon Sep 17 00:00:00 2001 From: riastradh Date: Mon, 28 Mar 2022 12:33:20 +0000 Subject: 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 --- sys/modules/examples/pollpal/pollpal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/modules') diff --git a/sys/modules/examples/pollpal/pollpal.c b/sys/modules/examples/pollpal/pollpal.c index b76e0733699..868f91615de 100644 --- a/sys/modules/examples/pollpal/pollpal.c +++ b/sys/modules/examples/pollpal/pollpal.c @@ -1,4 +1,4 @@ -/* $NetBSD: pollpal.c,v 1.3 2020/05/01 21:42:34 christos Exp $ */ +/* $NetBSD: pollpal.c,v 1.4 2022/03/28 12:33:22 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pollpal.c,v 1.3 2020/05/01 21:42:34 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pollpal.c,v 1.4 2022/03/28 12:33:22 riastradh Exp $"); #include #include @@ -311,7 +311,8 @@ pollpal_modcmd(modcmd_t cmd, void *arg __unused) case MODULE_CMD_FINI: if (pollpal_nopen != 0) return EBUSY; - return devsw_detach(NULL, &pollpal_cdevsw); + devsw_detach(NULL, &pollpal_cdevsw); + return 0; default: return ENOTTY; } -- cgit