Module Name:    src
Committed By:   tsutsui
Date:           Sat Sep  5 14:09:55 UTC 2009

Modified Files:
        src/sys/dev/pci: if_age.c if_ale.c if_bce.c if_bge.c if_bnx.c if_ipw.c
            if_iwi.c if_iwn.c if_lii.c if_msk.c if_nfe.c if_sip.c if_sk.c
            if_wm.c if_wpi.c

Log Message:
Invert logic around nested pmf(9) registrations for readability.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/pci/if_age.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ale.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.167 -r1.168 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/if_bnx.c src/sys/dev/pci/if_msk.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/pci/if_ipw.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pci/if_iwi.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_lii.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/if_nfe.c
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/pci/if_sip.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/if_sk.c
cvs rdiff -u -r1.179 -r1.180 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/if_wpi.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/pci/if_age.c
diff -u src/sys/dev/pci/if_age.c:1.32 src/sys/dev/pci/if_age.c:1.33
--- src/sys/dev/pci/if_age.c:1.32	Wed Aug  5 15:29:51 2009
+++ src/sys/dev/pci/if_age.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_age.c,v 1.32 2009/08/05 15:29:51 cegger Exp $ */
+/*	$NetBSD: if_age.c,v 1.33 2009/09/05 14:09:55 tsutsui Exp $ */
 /*	$OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $	*/
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.32 2009/08/05 15:29:51 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.33 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "vlan.h"
@@ -290,10 +290,10 @@
 	if_attach(ifp);
 	ether_ifattach(ifp, sc->sc_enaddr);
 
-	if (!pmf_device_register(self, NULL, age_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, age_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	return;
 

Index: src/sys/dev/pci/if_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.7 src/sys/dev/pci/if_ale.c:1.8
--- src/sys/dev/pci/if_ale.c:1.7	Tue Aug 18 06:02:36 2009
+++ src/sys/dev/pci/if_ale.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ale.c,v 1.7 2009/08/18 06:02:36 cegger Exp $	*/
+/*	$NetBSD: if_ale.c,v 1.8 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2008, Pyun YongHyeon <yong...@freebsd.org>
@@ -32,7 +32,7 @@
 /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.7 2009/08/18 06:02:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.8 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "vlan.h"
@@ -581,10 +581,10 @@
 	if_attach(ifp);
 	ether_ifattach(ifp, sc->ale_eaddr);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	return;
 fail:

Index: src/sys/dev/pci/if_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.26 src/sys/dev/pci/if_bce.c:1.27
--- src/sys/dev/pci/if_bce.c:1.26	Thu Jul 16 20:14:17 2009
+++ src/sys/dev/pci/if_bce.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.26 2009/07/16 20:14:17 jakllsch Exp $	 */
+/* $NetBSD: if_bce.c,v 1.27 2009/09/05 14:09:55 tsutsui Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.26 2009/07/16 20:14:17 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.27 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "vlan.h"
@@ -472,10 +472,10 @@
 #endif
 	callout_init(&sc->bce_timeout, 0);
 
-	if (!pmf_device_register(self, NULL, bce_resume)) {
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	} else
+	if (pmf_device_register(self, NULL, bce_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 /* handle media, and ethernet requests */

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.167 src/sys/dev/pci/if_bge.c:1.168
--- src/sys/dev/pci/if_bge.c:1.167	Sat Jul 25 13:52:47 2009
+++ src/sys/dev/pci/if_bge.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.167 2009/07/25 13:52:47 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.168 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.167 2009/07/25 13:52:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.168 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "vlan.h"
@@ -2647,10 +2647,10 @@
 	DPRINTFN(5, ("callout_init\n"));
 	callout_init(&sc->bge_timeout, 0);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static void

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.27 src/sys/dev/pci/if_bnx.c:1.28
--- src/sys/dev/pci/if_bnx.c:1.27	Tue May  5 10:21:22 2009
+++ src/sys/dev/pci/if_bnx.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.27 2009/05/05 10:21:22 cegger Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.28 2009/09/05 14:09:55 tsutsui Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.43 2007/01/30 03:21:10 krw Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.27 2009/05/05 10:21:22 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.28 2009/09/05 14:09:55 tsutsui Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -699,10 +699,10 @@
 
 	callout_init(&sc->bnx_timeout, 0);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	/* Print some important debugging info. */
 	DBRUN(BNX_INFO, bnx_dump_driver_state(sc));
Index: src/sys/dev/pci/if_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.27 src/sys/dev/pci/if_msk.c:1.28
--- src/sys/dev/pci/if_msk.c:1.27	Tue May 12 08:23:00 2009
+++ src/sys/dev/pci/if_msk.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.27 2009/05/12 08:23:00 cegger Exp $ */
+/* $NetBSD: if_msk.c,v 1.28 2009/09/05 14:09:55 tsutsui Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.42 2007/01/17 02:43:02 krw Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.27 2009/05/12 08:23:00 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.28 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -1118,10 +1118,10 @@
 	if_attach(ifp);
 	ether_ifattach(ifp, sc_if->sk_enaddr);
 
-	if (!pmf_device_register(self, NULL, msk_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, msk_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 #if NRND > 0
 	rnd_attach_source(&sc->rnd_source, device_xname(&sc->sk_dev),

Index: src/sys/dev/pci/if_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.48 src/sys/dev/pci/if_ipw.c:1.49
--- src/sys/dev/pci/if_ipw.c:1.48	Tue May 12 08:23:00 2009
+++ src/sys/dev/pci/if_ipw.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.48 2009/05/12 08:23:00 cegger Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.49 2009/09/05 14:09:55 tsutsui Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.48 2009/05/12 08:23:00 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.49 2009/09/05 14:09:55 tsutsui Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -327,10 +327,10 @@
 	 */
 	sc->dwelltime = 100;
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	ieee80211_announce(ic);
 

Index: src/sys/dev/pci/if_iwi.c
diff -u src/sys/dev/pci/if_iwi.c:1.81 src/sys/dev/pci/if_iwi.c:1.82
--- src/sys/dev/pci/if_iwi.c:1.81	Wed May  6 09:25:15 2009
+++ src/sys/dev/pci/if_iwi.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwi.c,v 1.81 2009/05/06 09:25:15 cegger Exp $  */
+/*	$NetBSD: if_iwi.c,v 1.82 2009/09/05 14:09:55 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 2004, 2005
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.81 2009/05/06 09:25:15 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.82 2009/09/05 14:09:55 tsutsui Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -429,10 +429,10 @@
 
 	iwi_sysctlattach(sc);	
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	ieee80211_announce(ic);
 

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.31 src/sys/dev/pci/if_iwn.c:1.32
--- src/sys/dev/pci/if_iwn.c:1.31	Tue May 12 08:23:00 2009
+++ src/sys/dev/pci/if_iwn.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.31 2009/05/12 08:23:00 cegger Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.32 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.31 2009/05/12 08:23:00 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.32 2009/09/05 14:09:55 tsutsui Exp $");
 
 
 /*
@@ -408,10 +408,10 @@
 	sc->amrr.amrr_min_success_threshold =  1;
 	sc->amrr.amrr_max_success_threshold = 15;
 
-	if (!pmf_device_register(self, NULL, iwn_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, iwn_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	iwn_radiotap_attach(sc);
 

Index: src/sys/dev/pci/if_lii.c
diff -u src/sys/dev/pci/if_lii.c:1.6 src/sys/dev/pci/if_lii.c:1.7
--- src/sys/dev/pci/if_lii.c:1.6	Sun Apr 26 06:56:46 2009
+++ src/sys/dev/pci/if_lii.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lii.c,v 1.6 2009/04/26 06:56:46 cegger Exp $	*/
+/*	$NetBSD: if_lii.c,v 1.7 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*
  *  Copyright (c) 2008 The NetBSD Foundation.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.6 2009/04/26 06:56:46 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.7 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 
@@ -340,10 +340,10 @@
 	if_attach(ifp);
 	ether_ifattach(ifp, eaddr);
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	return;
 

Index: src/sys/dev/pci/if_nfe.c
diff -u src/sys/dev/pci/if_nfe.c:1.45 src/sys/dev/pci/if_nfe.c:1.46
--- src/sys/dev/pci/if_nfe.c:1.45	Sun Jun 14 06:24:14 2009
+++ src/sys/dev/pci/if_nfe.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_nfe.c,v 1.45 2009/06/14 06:24:14 cegger Exp $	*/
+/*	$NetBSD: if_nfe.c,v 1.46 2009/09/05 14:09:55 tsutsui Exp $	*/
 /*	$OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $	*/
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.45 2009/06/14 06:24:14 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.46 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -412,10 +412,10 @@
 	callout_init(&sc->sc_tick_ch, 0);
 	callout_setfunc(&sc->sc_tick_ch, nfe_tick, sc);
 
-	if (!pmf_device_register(self, NULL, nfe_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, nfe_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	return;
 

Index: src/sys/dev/pci/if_sip.c
diff -u src/sys/dev/pci/if_sip.c:1.140 src/sys/dev/pci/if_sip.c:1.141
--- src/sys/dev/pci/if_sip.c:1.140	Tue May  5 21:34:13 2009
+++ src/sys/dev/pci/if_sip.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sip.c,v 1.140 2009/05/05 21:34:13 dyoung Exp $	*/
+/*	$NetBSD: if_sip.c,v 1.141 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.140 2009/05/05 21:34:13 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.141 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -1369,10 +1369,10 @@
 	}
 #endif /* SIP_EVENT_COUNTERS */
 
-	if (!pmf_device_register(self, sipcom_suspend, sipcom_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, sipcom_suspend, sipcom_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static inline void

Index: src/sys/dev/pci/if_sk.c
diff -u src/sys/dev/pci/if_sk.c:1.60 src/sys/dev/pci/if_sk.c:1.61
--- src/sys/dev/pci/if_sk.c:1.60	Thu Apr 23 09:18:25 2009
+++ src/sys/dev/pci/if_sk.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sk.c,v 1.60 2009/04/23 09:18:25 kefren Exp $	*/
+/*	$NetBSD: if_sk.c,v 1.61 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -115,7 +115,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.60 2009/04/23 09:18:25 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.61 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -1462,10 +1462,10 @@
             RND_TYPE_NET, 0);
 #endif
 
-	if (!pmf_device_register(self, NULL, sk_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, sk_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	DPRINTFN(2, ("sk_attach: end\n"));
 

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.179 src/sys/dev/pci/if_wm.c:1.180
--- src/sys/dev/pci/if_wm.c:1.179	Thu Aug  6 03:03:46 2009
+++ src/sys/dev/pci/if_wm.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.179 2009/08/06 03:03:46 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.180 2009/09/05 14:09:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.179 2009/08/06 03:03:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.180 2009/09/05 14:09:55 tsutsui Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -1679,10 +1679,10 @@
 	    NULL, xname, "rx_macctl");
 #endif /* WM_EVENT_COUNTERS */
 
-	if (!pmf_device_register(self, NULL, NULL))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, NULL))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	return;
 

Index: src/sys/dev/pci/if_wpi.c
diff -u src/sys/dev/pci/if_wpi.c:1.42 src/sys/dev/pci/if_wpi.c:1.43
--- src/sys/dev/pci/if_wpi.c:1.42	Wed May  6 09:25:16 2009
+++ src/sys/dev/pci/if_wpi.c	Sat Sep  5 14:09:55 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_wpi.c,v 1.42 2009/05/06 09:25:16 cegger Exp $    */
+/*  $NetBSD: if_wpi.c,v 1.43 2009/09/05 14:09:55 tsutsui Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.42 2009/05/06 09:25:16 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.43 2009/09/05 14:09:55 tsutsui Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -360,10 +360,10 @@
 
 	wpi_sysctlattach(sc);
 
-	if (!pmf_device_register(self, NULL, wpi_resume))
-		aprint_error_dev(self, "couldn't establish power handler\n");
-	else
+	if (pmf_device_register(self, NULL, wpi_resume))
 		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
 
 #if NBPFILTER > 0
 	bpfattach2(ifp, DLT_IEEE802_11_RADIO,

Reply via email to