Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Use pmf(9).



details:   https://anonhg.NetBSD.org/src/rev/f697253e7255
branches:  trunk
changeset: 997544:f697253e7255
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Mar 12 03:08:34 2019 +0000

description:
Use pmf(9).

diffstat:

 sys/dev/usb/if_aue.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 0c693c991e23 -r f697253e7255 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Tue Mar 12 02:07:14 2019 +0000
+++ b/sys/dev/usb/if_aue.c      Tue Mar 12 03:08:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.147 2019/01/22 06:38:53 skrll Exp $       */
+/*     $NetBSD: if_aue.c,v 1.148 2019/03/12 03:08:34 msaitoh Exp $     */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.147 2019/01/22 06:38:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.148 2019/03/12 03:08:34 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -873,6 +873,9 @@
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->aue_udev, sc->aue_dev);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 }
 
@@ -890,6 +893,8 @@
                return 0;
        }
 
+       pmf_device_deregister(self);
+
        /*
         * XXX Halting callout guarantees no more tick tasks.  What
         * guarantees no more stop tasks?  What guarantees no more



Home | Main Index | Thread Index | Old Index