From 516792c317f00ef957252faa6872e258038462b5 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 30 Mar 2006 18:16:20 +0000 Subject: [PATCH] Use device_private() more. --- sys/dev/tc/bba.c | 11 ++++++----- sys/dev/tc/if_le_ioasic.c | 14 +++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/sys/dev/tc/bba.c b/sys/dev/tc/bba.c index 0ae20e1ddda0..cd172385a33d 100644 --- a/sys/dev/tc/bba.c +++ b/sys/dev/tc/bba.c @@ -1,4 +1,4 @@ -/* $NetBSD: bba.c,v 1.28 2006/03/30 18:14:37 thorpej Exp $ */ +/* $NetBSD: bba.c,v 1.29 2006/03/30 18:16:20 thorpej Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ /* maxine/alpha baseboard audio (bba) */ #include -__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.28 2006/03/30 18:14:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bba.c,v 1.29 2006/03/30 18:16:20 thorpej Exp $"); #include #include @@ -216,13 +216,14 @@ bba_attach(struct device *parent, struct device *self, void *aux) struct ioasicdev_attach_args *ia; struct bba_softc *sc; struct am7930_softc *asc; + struct ioasic_softc *iosc = device_private(parent); ia = aux; sc = device_private(self); asc = &sc->sc_am7930; - sc->sc_bst = ((struct ioasic_softc *)parent)->sc_bst; - sc->sc_bsh = ((struct ioasic_softc *)parent)->sc_bsh; - sc->sc_dmat = ((struct ioasic_softc *)parent)->sc_dmat; + sc->sc_bst = iosc->sc_bst; + sc->sc_bsh = iosc->sc_bsh; + sc->sc_dmat = iosc->sc_dmat; /* get the bus space handle for codec */ if (bus_space_subregion(sc->sc_bst, sc->sc_bsh, diff --git a/sys/dev/tc/if_le_ioasic.c b/sys/dev/tc/if_le_ioasic.c index adfe14e20c5a..a15725a2729d 100644 --- a/sys/dev/tc/if_le_ioasic.c +++ b/sys/dev/tc/if_le_ioasic.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_le_ioasic.c,v 1.25 2006/03/30 16:18:49 thorpej Exp $ */ +/* $NetBSD: if_le_ioasic.c,v 1.26 2006/03/30 18:18:39 thorpej Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_le_ioasic.c,v 1.25 2006/03/30 16:18:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_le_ioasic.c,v 1.26 2006/03/30 18:18:39 thorpej Exp $"); #include "opt_inet.h" @@ -110,6 +110,7 @@ le_ioasic_attach(parent, self, aux) struct le_ioasic_softc *sc = device_private(self); struct ioasicdev_attach_args *d = aux; struct lance_softc *le = &sc->sc_am7990.lsc; + struct ioasic_softc *iosc = device_private(parent); bus_space_tag_t ioasic_bst; bus_space_handle_t ioasic_bsh; bus_dma_tag_t dmat; @@ -119,9 +120,9 @@ le_ioasic_attach(parent, self, aux) int rseg; caddr_t le_iomem; - ioasic_bst = ((struct ioasic_softc *)parent)->sc_bst; - ioasic_bsh = ((struct ioasic_softc *)parent)->sc_bsh; - dmat = sc->sc_dmat = ((struct ioasic_softc *)parent)->sc_dmat; + ioasic_bst = iosc->sc_bst; + ioasic_bsh = iosc->sc_bsh; + dmat = sc->sc_dmat = iosc->sc_dmat; /* * Allocate a DMA area for the chip. */ @@ -168,8 +169,7 @@ le_ioasic_attach(parent, self, aux) le->sc_zerobuf = le_ioasic_zerobuf_gap16; dec_le_common_attach(&sc->sc_am7990, - (u_char *)((struct ioasic_softc *)parent)->sc_base - + IOASIC_SLOT_2_START); + (u_char *)iosc->sc_base + IOASIC_SLOT_2_START); ioasic_intr_establish(parent, d->iada_cookie, TC_IPL_NET, am7990_intr, sc);