Module Name:    src
Committed By:   snj
Date:           Sat Oct  3 21:53:01 UTC 2009

Modified Files:
        src/sys/dev/pci [netbsd-5]: if_vr.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1022):
        sys/dev/pci/if_vr.c: revision 1.98
Replace shutdownhook_establish(9) with pmf_device_register1(9).
Tested VIA VT86C100A (which is probed as VT3043).


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.95.4.1 src/sys/dev/pci/if_vr.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_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.95 src/sys/dev/pci/if_vr.c:1.95.4.1
--- src/sys/dev/pci/if_vr.c:1.95	Wed Jul  9 16:14:57 2008
+++ src/sys/dev/pci/if_vr.c	Sat Oct  3 21:53:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.95 2008/07/09 16:14:57 joerg Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.95 2008/07/09 16:14:57 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.95.4.1 2009/10/03 21:53:01 snj Exp $");
 
 #include "rnd.h"
 
@@ -207,7 +207,6 @@
 struct vr_softc {
 	device_t		vr_dev;
 	void			*vr_ih;		/* interrupt cookie */
-	void			*vr_ats;	/* shutdown hook */
 	bus_space_tag_t		vr_bst;		/* bus space tag */
 	bus_space_handle_t	vr_bsh;		/* bus space handle */
 	bus_dma_tag_t		vr_dmat;	/* bus DMA tag */
@@ -1398,7 +1397,7 @@
 
 static int	vr_probe(device_t, struct cfdata *, void *);
 static void	vr_attach(device_t, device_t, void *);
-static void	vr_shutdown(void *);
+static bool	vr_shutdown(device_t, int);
 
 CFATTACH_DECL_NEW(vr, sizeof (struct vr_softc),
     vr_probe, vr_attach, NULL, NULL);
@@ -1431,12 +1430,14 @@
  * Stop all chip I/O so that the kernel's probe routines don't
  * get confused by errant DMAs when rebooting.
  */
-static void
-vr_shutdown(void *arg)
+static bool
+vr_shutdown(device_t self, int howto)
 {
-	struct vr_softc *sc = (struct vr_softc *)arg;
+	struct vr_softc *sc = device_private(self);
 
 	vr_stop(&sc->vr_ec.ec_if, 1);
+
+	return true;
 }
 
 /*
@@ -1712,9 +1713,11 @@
 	    RND_TYPE_NET, 0);
 #endif
 
-	sc->vr_ats = shutdownhook_establish(vr_shutdown, sc);
-	if (sc->vr_ats == NULL)
-		aprint_error_dev(self, "warning: couldn't establish shutdown hook\n");
+	if (pmf_device_register1(self, NULL, NULL, vr_shutdown))
+		pmf_class_network_register(self, ifp);
+	else
+		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 
  fail_5:

Reply via email to