Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys kern: device_pmf_driver_register never fails, so make it...



details:   https://anonhg.NetBSD.org/src/rev/734c821e5316
branches:  trunk
changeset: 369619:734c821e5316
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 24 11:18:56 2022 +0000

description:
kern: device_pmf_driver_register never fails, so make it return void.

No ABI bump despite change to device.h because this is used only
inside autoconf.

diffstat:

 sys/kern/kern_pmf.c      |  7 +++----
 sys/kern/subr_autoconf.c |  8 ++++----
 sys/sys/device.h         |  4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)

diffs (85 lines):

diff -r 995e0ea910b2 -r 734c821e5316 sys/kern/kern_pmf.c
--- a/sys/kern/kern_pmf.c       Wed Aug 24 06:39:14 2022 +0000
+++ b/sys/kern/kern_pmf.c       Wed Aug 24 11:18:56 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pmf.c,v 1.48 2022/03/28 12:38:59 riastradh Exp $ */
+/* $NetBSD: kern_pmf.c,v 1.49 2022/08/24 11:18:56 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.48 2022/03/28 12:38:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.49 2022/08/24 11:18:56 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -417,9 +417,8 @@
     bool (*resume)(device_t, const pmf_qual_t *),
     bool (*shutdown)(device_t, int))
 {
-       if (!device_pmf_driver_register(dev, suspend, resume, shutdown))
-               return false;
 
+       device_pmf_driver_register(dev, suspend, resume, shutdown);
        if (!device_pmf_driver_child_register(dev)) {
                device_pmf_driver_deregister(dev);
                return false;
diff -r 995e0ea910b2 -r 734c821e5316 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Wed Aug 24 06:39:14 2022 +0000
+++ b/sys/kern/subr_autoconf.c  Wed Aug 24 11:18:56 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.302 2022/08/12 16:16:12 riastradh Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.303 2022/08/24 11:18:56 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.302 2022/08/12 16:16:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.303 2022/08/24 11:18:56 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -3137,17 +3137,17 @@
        return true;
 }
 
-bool
+void
 device_pmf_driver_register(device_t dev,
     bool (*suspend)(device_t, const pmf_qual_t *),
     bool (*resume)(device_t, const pmf_qual_t *),
     bool (*shutdown)(device_t, int))
 {
+
        dev->dv_driver_suspend = suspend;
        dev->dv_driver_resume = resume;
        dev->dv_driver_shutdown = shutdown;
        dev->dv_flags |= DVF_POWER_HANDLERS;
-       return true;
 }
 
 void
diff -r 995e0ea910b2 -r 734c821e5316 sys/sys/device.h
--- a/sys/sys/device.h  Wed Aug 24 06:39:14 2022 +0000
+++ b/sys/sys/device.h  Wed Aug 24 11:18:56 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.182 2022/03/28 12:38:59 riastradh Exp $ */
+/* $NetBSD: device.h,v 1.183 2022/08/24 11:18:56 riastradh Exp $ */
 
 /*
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -686,7 +686,7 @@
 bool           device_pmf_driver_resume(device_t, const pmf_qual_t *);
 bool           device_pmf_driver_shutdown(device_t, int);
 
-bool           device_pmf_driver_register(device_t,
+void           device_pmf_driver_register(device_t,
                    bool (*)(device_t, const pmf_qual_t *),
                    bool (*)(device_t, const pmf_qual_t *),
                    bool (*)(device_t, int));



Home | Main Index | Thread Index | Old Index