Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb no need to device_pmf_is_registered() before unr...



details:   https://anonhg.NetBSD.org/src/rev/73ad92696b57
branches:  trunk
changeset: 778576:73ad92696b57
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Apr 05 16:31:53 2012 +0000

description:
no need to device_pmf_is_registered() before unregister

diffstat:

 sys/dev/usb/if_cdce.c |  7 +++----
 sys/dev/usb/ubt.c     |  9 +++++----
 sys/dev/usb/uhso.c    |  7 +++----
 3 files changed, 11 insertions(+), 12 deletions(-)

diffs (95 lines):

diff -r e34eb6e73366 -r 73ad92696b57 sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Thu Apr 05 16:16:01 2012 +0000
+++ b/sys/dev/usb/if_cdce.c     Thu Apr 05 16:31:53 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -309,8 +309,7 @@
        struct ifnet    *ifp = GET_IFP(sc);
        int              s;
 
-       if (device_pmf_is_registered(self))
-               pmf_device_deregister(self);
+       pmf_device_deregister(self);
 
        s = splusb();
 
diff -r e34eb6e73366 -r 73ad92696b57 sys/dev/usb/ubt.c
--- a/sys/dev/usb/ubt.c Thu Apr 05 16:16:01 2012 +0000
+++ b/sys/dev/usb/ubt.c Thu Apr 05 16:31:53 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $     */
+/*     $NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $  */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -533,8 +533,10 @@
        }
 
        sc->sc_ok = 1;
+
        if (!pmf_device_register(self, NULL, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 }
 
@@ -546,8 +548,7 @@
 
        DPRINTF("sc=%p flags=%d\n", sc, flags);
 
-       if (device_pmf_is_registered(self))
-               pmf_device_deregister(self);
+       pmf_device_deregister(self);
 
        sc->sc_dying = 1;
 
diff -r e34eb6e73366 -r 73ad92696b57 sys/dev/usb/uhso.c
--- a/sys/dev/usb/uhso.c        Thu Apr 05 16:16:01 2012 +0000
+++ b/sys/dev/usb/uhso.c        Thu Apr 05 16:31:53 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $     */
+/*     $NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $  */
 
 /*-
  * Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $");
 
 #include "opt_inet.h"
 
@@ -537,8 +537,7 @@
        unsigned int i;
        int s;
 
-       if (device_pmf_is_registered(self))
-               pmf_device_deregister(self);
+       pmf_device_deregister(self);
 
        for (i = 0; i < UHSO_PORT_MAX; i++) {
                hp = sc->sc_port[i];



Home | Main Index | Thread Index | Old Index