summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordyoung <dyoung@NetBSD.org>2010-03-24 01:13:30 +0000
committerdyoung <dyoung@NetBSD.org>2010-03-24 01:13:30 +0000
commitf52f7d91ef4bdc61409ddf02c017a1a5546bd450 (patch)
tree7555b0a4125c755fb17be4075c055c527e1f803f /sys/dev
parent6e669af40f875a1ee73ea8f10ba90719a36489a2 (diff)
Do not use unitialized bus_space_tag_t's. Use the tag(s) from the
attachment arguments.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi_ec.c21
-rw-r--r--sys/dev/isa/pas.c14
2 files changed, 21 insertions, 14 deletions
diff --git a/sys/dev/acpi/acpi_ec.c b/sys/dev/acpi/acpi_ec.c
index c93bd31be92..ef89ee2d2ae 100644
--- a/sys/dev/acpi/acpi_ec.c
+++ b/sys/dev/acpi/acpi_ec.c
@@ -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 <joerg@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 int acpiec_match(device_t, cfdata_t, void *);
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 @@ acpiecdt_match(device_t parent, cfdata_t match, void *aux)
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 @@ acpiecdt_attach(device_t parent, device_t self, void *aux)
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_attach(device_t parent, device_t self, void *aux)
}
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 @@ free_res:
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;
diff --git a/sys/dev/isa/pas.c b/sys/dev/isa/pas.c
index 15ee4c21266..309d518a2c9 100644
--- a/sys/dev/isa/pas.c
+++ b/sys/dev/isa/pas.c
@@ -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 @@ pasprobe(device_t parent, cfdata_t match, void *aux)
return 0;
memset(sc, 0, sizeof *sc);
- return pasfind(match, sc, aux, PASPROBE);
+ return pasfind(match, sc, ia, PASPROBE);
}
/*
@@ -309,7 +309,7 @@ pasfind(cfdata_t match, struct pas_softc *sc,
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 @@ pasfind(cfdata_t match, struct pas_softc *sc,
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 @@ pasfind(cfdata_t match, struct pas_softc *sc,
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;
}