Module Name:    src
Committed By:   msaitoh
Date:           Tue Mar 12 03:08:34 UTC 2019

Modified Files:
        src/sys/dev/usb: if_aue.c

Log Message:
 Use pmf(9).


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/usb/if_aue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.147 src/sys/dev/usb/if_aue.c:1.148
--- src/sys/dev/usb/if_aue.c:1.147	Tue Jan 22 06:38:53 2019
+++ src/sys/dev/usb/if_aue.c	Tue Mar 12 03:08:34 2019
@@ -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 @@ aue_attach(device_t parent, device_t sel
 
 	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 @@ aue_detach(device_t self, int flags)
 		return 0;
 	}
 
+	pmf_device_deregister(self);
+
 	/*
 	 * XXX Halting callout guarantees no more tick tasks.  What
 	 * guarantees no more stop tasks?  What guarantees no more

Reply via email to