Module Name:    src
Committed By:   christos
Date:           Sat Jan  2 01:43:12 UTC 2010

Modified Files:
        src/sys/dev/pcmcia: if_ne_pcmcia.c

Log Message:
convert to pmf


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/pcmcia/if_ne_pcmcia.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/pcmcia/if_ne_pcmcia.c
diff -u src/sys/dev/pcmcia/if_ne_pcmcia.c:1.157 src/sys/dev/pcmcia/if_ne_pcmcia.c:1.158
--- src/sys/dev/pcmcia/if_ne_pcmcia.c:1.157	Sat Sep  5 10:44:59 2009
+++ src/sys/dev/pcmcia/if_ne_pcmcia.c	Fri Jan  1 20:43:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_pcmcia.c,v 1.157 2009/09/05 14:44:59 tsutsui Exp $	*/
+/*	$NetBSD: if_ne_pcmcia.c,v 1.158 2010/01/02 01:43:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.157 2009/09/05 14:44:59 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.158 2010/01/02 01:43:11 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -80,7 +80,6 @@
 	struct pcmcia_function *sc_pf;		/* our PCMCIA function */
 	int sc_state;
 #define	NE_PCMCIA_ATTACHED	3
-	void *sc_powerhook;			/* power management hook */
 };
 
 u_int8_t *ne_pcmcia_get_enaddr(struct ne_pcmcia_softc *, int,
@@ -733,13 +732,9 @@
 	if (ne2000_attach(nsc, enaddr))
 		goto fail2;
 
-	/* dopowerhooks(9) - deprecated, only called by hpcs* apmdev(4) */
-	psc->sc_powerhook = powerhook_establish(device_xname(self),
-	    ne2000_power, nsc);
-	if (psc->sc_powerhook == NULL)
-		aprint_error_dev(self,
-		   "WARNING: unable to establish power hook\n");
-
+	if (!pmf_device_register(self, ne2000_suspend, ne2000_resume)) {
+		aprint_error_dev(self, "cannot set power mgmt handler\n");
+	}
 	/* pmf(9) power hooks */
 	if (pmf_device_register(self, ne2000_suspend, ne2000_resume)) {
 #if 0 /* XXX: notyet: if_stop is NULL! */
@@ -768,9 +763,7 @@
 	if (psc->sc_state != NE_PCMCIA_ATTACHED)
 		return (0);
 
-	if (psc->sc_powerhook != NULL)
-		powerhook_disestablish(psc->sc_powerhook);
-
+	pmf_device_deregister(self);
 	error = ne2000_detach(&psc->sc_ne2000, flags);
 	if (error)
 		return (error);

Reply via email to