Module Name:    src
Committed By:   dyoung
Date:           Wed Mar 24 01:13:30 UTC 2010

Modified Files:
        src/sys/dev/acpi: acpi_ec.c
        src/sys/dev/isa: pas.c

Log Message:
Do not use unitialized bus_space_tag_t's.  Use the tag(s) from the
attachment arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/acpi/acpi_ec.c
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/isa/pas.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/acpi/acpi_ec.c
diff -u src/sys/dev/acpi/acpi_ec.c:1.62 src/sys/dev/acpi/acpi_ec.c:1.63
--- src/sys/dev/acpi/acpi_ec.c:1.62	Fri Mar  5 14:00:16 2010
+++ src/sys/dev/acpi/acpi_ec.c	Wed Mar 24 01:13:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_ec.c,v 1.62 2010/03/05 14:00:16 jruoho Exp $	*/
+/*	$NetBSD: acpi_ec.c,v 1.63 2010/03/24 01:13:30 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <jo...@netbsd.org>.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.62 2010/03/05 14:00:16 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.63 2010/03/24 01:13:30 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -149,7 +149,8 @@
 static void acpiec_attach(device_t, device_t, void *);
 
 static void acpiec_common_attach(device_t, device_t, ACPI_HANDLE,
-    bus_addr_t, bus_addr_t, ACPI_HANDLE, uint8_t);
+    bus_space_tag_t, bus_addr_t, bus_space_tag_t, bus_addr_t,
+    ACPI_HANDLE, uint8_t);
 
 static bool acpiec_suspend(device_t, const pmf_qual_t *);
 static bool acpiec_resume(device_t, const pmf_qual_t *);
@@ -225,6 +226,7 @@
 static void
 acpiecdt_attach(device_t parent, device_t self, void *aux)
 {
+	struct acpi_attach_args *aa = aux;
 	ACPI_HANDLE ec_handle;
 	bus_addr_t cmd_reg, data_reg;
 	uint8_t gpebit;
@@ -235,8 +237,8 @@
 	aprint_naive("\n");
 	aprint_normal(": ACPI Embedded Controller via ECDT\n");
 
-	acpiec_common_attach(parent, self, ec_handle, cmd_reg, data_reg,
-	    NULL, gpebit);
+	acpiec_common_attach(parent, self, ec_handle, aa->aa_iot, cmd_reg,
+	    aa->aa_iot, data_reg, NULL, gpebit);
 }
 
 static int
@@ -290,7 +292,8 @@
 	}
 
 	acpiec_common_attach(parent, self, aa->aa_node->ad_handle,
-	    io1->ar_base, io0->ar_base, gpe_handle, gpebit);
+	    aa->aa_iot, io1->ar_base, aa->aa_iot, io0->ar_base,
+	    gpe_handle, gpebit);
 
 free_res:
 	acpi_resource_cleanup(&ec_res);
@@ -298,13 +301,17 @@
 
 static void
 acpiec_common_attach(device_t parent, device_t self,
-    ACPI_HANDLE ec_handle, bus_addr_t cmd_reg, bus_addr_t data_reg,
+    ACPI_HANDLE ec_handle, bus_space_tag_t cmdt, bus_addr_t cmd_reg,
+    bus_space_tag_t datat, bus_addr_t data_reg,
     ACPI_HANDLE gpe_handle, uint8_t gpebit)
 {
 	struct acpiec_softc *sc = device_private(self);
 	ACPI_STATUS rv;
 	ACPI_INTEGER val;
 
+	sc->sc_csr_st = cmdt;
+	sc->sc_data_st = datat;
+
 	sc->sc_ech = ec_handle;
 	sc->sc_gpeh = gpe_handle;
 	sc->sc_gpebit = gpebit;

Index: src/sys/dev/isa/pas.c
diff -u src/sys/dev/isa/pas.c:1.67 src/sys/dev/isa/pas.c:1.68
--- src/sys/dev/isa/pas.c:1.67	Sat Mar 15 21:09:02 2008
+++ src/sys/dev/isa/pas.c	Wed Mar 24 01:13:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pas.c,v 1.67 2008/03/15 21:09:02 cube Exp $	*/
+/*	$NetBSD: pas.c,v 1.68 2010/03/24 01:13:30 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -57,7 +57,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pas.c,v 1.67 2008/03/15 21:09:02 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pas.c,v 1.68 2010/03/24 01:13:30 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -287,7 +287,7 @@
 		return 0;
 
 	memset(sc, 0, sizeof *sc);
-	return pasfind(match, sc, aux, PASPROBE);
+	return pasfind(match, sc, ia, PASPROBE);
 }
 
 /*
@@ -309,7 +309,7 @@
 		return 0;
 	}
 
-	if (bus_space_map(sc->sc_sbdsp.sc_iot, PAS_DEFAULT_BASE, 1, 0,
+	if (bus_space_map(ia->ia_iot, PAS_DEFAULT_BASE, 1, 0,
 	    &sc->pas_port_handle)) {
 		printf("pas: can't map base register %x in probe\n",
 		    PAS_DEFAULT_BASE);
@@ -395,7 +395,7 @@
 	sc->sc_sbdsp.sc_iot = ia->ia_iot;
 
 	/* Map i/o space [we map 24 ports which is the max of the sb and pro */
-	if (bus_space_map(sc->sc_sbdsp.sc_iot, ia->ia_io[0].ir_addr,
+	if (bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr,
 	    SBP_NPORT, 0, &sc->sc_sbdsp.sc_ioh)) {
 		printf("pas: can't map i/o space 0x%x/%d in probe\n",
 		    ia->ia_io[0].ir_addr, SBP_NPORT);
@@ -444,11 +444,11 @@
 
  unmap:
 	if (rc == 0 || probing)
-		bus_space_unmap(sc->sc_sbdsp.sc_iot, sc->sc_sbdsp.sc_ioh,
+		bus_space_unmap(ia->ia_iot, sc->sc_sbdsp.sc_ioh,
 		    SBP_NPORT);
  unmap1:
 	if (rc == 0 || probing)
-		bus_space_unmap(sc->sc_sbdsp.sc_iot, PAS_DEFAULT_BASE, 1);
+		bus_space_unmap(ia->ia_iot, PAS_DEFAULT_BASE, 1);
 	return rc;
 }
 

Reply via email to