Module Name:    src
Committed By:   cegger
Date:           Sun Apr 26 09:56:46 UTC 2009

Modified Files:
        src/sys/dev/pci: if_bwi_pci.c

Log Message:
prepare device_t/softc split


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_bwi_pci.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_bwi_pci.c
diff -u src/sys/dev/pci/if_bwi_pci.c:1.4 src/sys/dev/pci/if_bwi_pci.c:1.5
--- src/sys/dev/pci/if_bwi_pci.c:1.4	Thu Apr 23 20:24:23 2009
+++ src/sys/dev/pci/if_bwi_pci.c	Sun Apr 26 09:56:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bwi_pci.c,v 1.4 2009/04/23 20:24:23 kefren Exp $	*/
+/*	$NetBSD: if_bwi_pci.c,v 1.5 2009/04/26 09:56:46 cegger Exp $	*/
 /*	$OpenBSD: if_bwi_pci.c,v 1.6 2008/02/14 22:10:02 brad Exp $ */
 
 /*
@@ -25,7 +25,7 @@
 #include "bpfilter.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.4 2009/04/23 20:24:23 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bwi_pci.c,v 1.5 2009/04/26 09:56:46 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -57,9 +57,9 @@
 /* Base Address Register */
 #define BWI_PCI_BAR0	0x10
 
-static int	bwi_pci_match(struct device *, struct cfdata *, void *);
-static void	bwi_pci_attach(struct device *, struct device *, void *);
-static int	bwi_pci_detach(struct device *, int);
+static int	bwi_pci_match(device_t, cfdata_t, void *);
+static void	bwi_pci_attach(device_t, device_t, void *);
+static int	bwi_pci_detach(device_t, int);
 static void	bwi_pci_conf_write(void *, uint32_t, uint32_t);
 static uint32_t	bwi_pci_conf_read(void *, uint32_t);
 
@@ -76,7 +76,7 @@
     bwi_pci_match, bwi_pci_attach, bwi_pci_detach, NULL);
 
 static int
-bwi_pci_match(struct device *parent, struct cfdata *match, void *aux)
+bwi_pci_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct pci_attach_args *pa = aux;
 
@@ -103,9 +103,9 @@
 }
 
 static void
-bwi_pci_attach(struct device *parent, struct device *self, void *aux)
+bwi_pci_attach(device_t parent, device_t self, void *aux)
 {
-	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)self;
+	struct bwi_pci_softc *psc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	struct bwi_softc *sc = &psc->psc_bwi;
 	const char *intrstr = NULL;
@@ -168,9 +168,9 @@
 }
 
 int
-bwi_pci_detach(struct device *self, int flags)
+bwi_pci_detach(device_t self, int flags)
 {
-	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)self;
+	struct bwi_pci_softc *psc = device_private(self);
 	struct bwi_softc *sc = &psc->psc_bwi;
 
 	pmf_device_deregister(self);
@@ -186,17 +186,17 @@
 }
 
 static void
-bwi_pci_conf_write(void *self, uint32_t reg, uint32_t val)
+bwi_pci_conf_write(void *sc, uint32_t reg, uint32_t val)
 {
-	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)self;
+	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)sc;
 
 	pci_conf_write(psc->psc_pc, psc->psc_pcitag, reg, val);
 }
 
 static uint32_t
-bwi_pci_conf_read(void *self, uint32_t reg)
+bwi_pci_conf_read(void *sc, uint32_t reg)
 {
-	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)self;
+	struct bwi_pci_softc *psc = (struct bwi_pci_softc *)sc;
 
 	return (pci_conf_read(psc->psc_pc, psc->psc_pcitag, reg));
 }

Reply via email to