Use device_private() more.

This commit is contained in:
thorpej 2006-03-30 18:16:20 +00:00
parent 6ecb4ef75f
commit 516792c317
2 changed files with 13 additions and 12 deletions

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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,

View File

@ -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 <sys/cdefs.h>
__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);