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/83c0f1e89292
branches:  trunk
changeset: 449475:83c0f1e89292
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Mar 08 03:05:15 2019 +0000

description:
Use pmf(9).

diffstat:

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

diffs (37 lines):

diff -r 0be1392b7321 -r 83c0f1e89292 sys/dev/usb/if_url.c
--- a/sys/dev/usb/if_url.c      Fri Mar 08 02:53:22 2019 +0000
+++ b/sys/dev/usb/if_url.c      Fri Mar 08 03:05:15 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_url.c,v 1.61 2019/01/22 03:42:28 msaitoh Exp $      */
+/*     $NetBSD: if_url.c,v 1.62 2019/03/08 03:05:15 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.61 2019/01/22 03:42:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.62 2019/03/08 03:05:15 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -325,6 +325,9 @@
 
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, sc->sc_dev);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 
  bad:
@@ -346,6 +349,8 @@
        if (!sc->sc_attached)
                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