Use device_parent().

This commit is contained in:
thorpej 2006-03-25 23:14:58 +00:00
parent 4ed37fa0d7
commit 6e53f1366a
15 changed files with 81 additions and 73 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.64 2006/01/06 09:21:44 yamt Exp $ */
/* $NetBSD: fd.c,v 1.65 2006/03/25 23:14:58 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.64 2006/01/06 09:21:44 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.65 2006/03/25 23:14:58 thorpej Exp $");
#include "rnd.h"
#include "opt_ddb.h"
@ -626,7 +626,7 @@ fdstrategy(bp)
fdstart(fd);
#ifdef DIAGNOSTIC
else {
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
struct fdc_softc *fdc = (void *)device_parent(&fd->sc_dev);
if (fdc->sc_state == DEVIDLE) {
printf("fdstrategy: controller inactive\n");
fdcstart(fdc);
@ -648,7 +648,7 @@ void
fdstart(fd)
struct fd_softc *fd;
{
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
struct fdc_softc *fdc = (void *)device_parent(&fd->sc_dev);
int active = !TAILQ_EMPTY(&fdc->sc_drives);
/* Link into controller queue. */
@ -665,7 +665,7 @@ fdfinish(fd, bp)
struct fd_softc *fd;
struct buf *bp;
{
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
struct fdc_softc *fdc = (void *)device_parent(&fd->sc_dev);
/*
* Move this drive to the end of the queue to give others a `fair'
@ -745,7 +745,7 @@ fd_motor_off(arg)
s = splbio();
fd->sc_flags &= ~(FD_MOTOR | FD_MOTOR_WAIT);
fd_set_motor((struct fdc_softc *)fd->sc_dev.dv_parent, 0);
fd_set_motor((struct fdc_softc *)device_parent(&fd->sc_dev), 0);
splx(s);
}
@ -754,7 +754,7 @@ fd_motor_on(arg)
void *arg;
{
struct fd_softc *fd = arg;
struct fdc_softc *fdc = (void *)fd->sc_dev.dv_parent;
struct fdc_softc *fdc = (void *)device_parent(&fd->sc_dev);
int s;
s = splbio();
@ -880,7 +880,7 @@ fdcstatus(dv, n, s)
int n;
const char *s;
{
struct fdc_softc *fdc = (void *)dv->dv_parent;
struct fdc_softc *fdc = (void *)device_parent(dv);
char bits[64];
if (n == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: gus.c,v 1.91 2006/03/17 23:29:07 christos Exp $ */
/* $NetBSD: gus.c,v 1.92 2006/03/25 23:14:58 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1999 The NetBSD Foundation, Inc.
@ -95,7 +95,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.91 2006/03/17 23:29:07 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.92 2006/03/25 23:14:58 thorpej Exp $");
#include "gus.h"
#if NGUS > 0
@ -1472,7 +1472,7 @@ gus_dmaout_timeout(void *arg)
bus_space_write_1(iot, ioh2, GUS_DATA_HIGH, 0);
#if 0
/* XXX we will dmadone below? */
isa_dmaabort(sc->sc_dev.dv_parent, sc->sc_playdrq);
isa_dmaabort(device_parent(&sc->sc_dev), sc->sc_playdrq);
#endif
gus_dmaout_dointr(sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_gfe.c,v 1.17 2005/12/11 12:22:16 christos Exp $ */
/* $NetBSD: if_gfe.c,v 1.18 2006/03/25 23:15:54 thorpej Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.17 2005/12/11 12:22:16 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.18 2006/03/25 23:15:54 thorpej Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -1372,7 +1372,8 @@ gfe_tx_start(struct gfe_softc *sc, enum gfe_txprio txprio)
}
#if 0
GE_DPRINTF(sc, ("(ectdp=%#x", txq->txq_ectdp));
gt_write(sc->sc_dev.dv_parent, txq->txq_ectdp, txq->txq_desc_busaddr);
gt_write(device_parent(&sc->sc_dev), txq->txq_ectdp,
txq->txq_desc_busaddr);
GE_DPRINTF(sc, (")"));
#endif
@ -1508,13 +1509,13 @@ gfe_mii_mediastatus (struct ifnet *ifp, struct ifmediareq *ifmr)
int
gfe_mii_read (struct device *self, int phy, int reg)
{
return gt_mii_read(self, self->dv_parent, phy, reg);
return gt_mii_read(self, device_parent(self), phy, reg);
}
void
gfe_mii_write (struct device *self, int phy, int reg, int value)
{
gt_mii_write(self, self->dv_parent, phy, reg, value);
gt_mii_write(self, device_parent(self), phy, reg, value);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mii_physubr.c,v 1.47 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: mii_physubr.c,v 1.48 2006/03/25 23:17:36 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.47 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.48 2006/03/25 23:17:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -385,7 +385,7 @@ mii_phy_update(struct mii_softc *sc, int cmd)
sc->mii_media_status != mii->mii_media_status ||
cmd == MII_MEDIACHG) {
mii_phy_statusmsg(sc);
(*mii->mii_statchg)(sc->mii_dev.dv_parent);
(*mii->mii_statchg)(device_parent(&sc->mii_dev));
sc->mii_media_active = mii->mii_media_active;
sc->mii_media_status = mii->mii_media_status;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: miivar.h,v 1.45 2006/02/18 19:51:07 joerg Exp $ */
/* $NetBSD: miivar.h,v 1.46 2006/03/25 23:17:36 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -209,11 +209,11 @@ struct mii_media {
#ifdef _KERNEL
#define PHY_READ(p, r) \
(*(p)->mii_pdata->mii_readreg)((p)->mii_dev.dv_parent, \
(*(p)->mii_pdata->mii_readreg)(device_parent(&(p)->mii_dev), \
(p)->mii_phy, (r))
#define PHY_WRITE(p, r, v) \
(*(p)->mii_pdata->mii_writereg)((p)->mii_dev.dv_parent, \
(*(p)->mii_pdata->mii_writereg)(device_parent(&(p)->mii_dev), \
(p)->mii_phy, (r), (v))
#define PHY_SERVICE(p, d, o) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: rlphy.c,v 1.7 2006/03/14 04:48:44 chs Exp $ */
/* $NetBSD: rlphy.c,v 1.8 2006/03/25 23:17:36 thorpej Exp $ */
/* $OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $ */
/*
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.7 2006/03/14 04:48:44 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.8 2006/03/25 23:17:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -316,7 +316,7 @@ rlphy_status(struct mii_softc *sc)
* can test the 'SPEED10' bit of the MAC's media status
* register.
*/
if (device_is_a(sc->mii_dev.dv_parent, "rtk")) {
if (device_is_a(device_parent(&sc->mii_dev), "rtk")) {
if (PHY_READ(sc, RTK_MEDIASTAT) & RTK_MEDIASTAT_SPEED10)
mii->mii_media_active |= IFM_10_T;
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: tlphy.c,v 1.44 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: tlphy.c,v 1.45 2006/03/25 23:17:36 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.44 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.45 2006/03/25 23:17:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -141,7 +141,7 @@ static void
tlphyattach(struct device *parent, struct device *self, void *aux)
{
struct tlphy_softc *sc = (struct tlphy_softc *)self;
struct tl_softc *tlsc = (struct tl_softc *)self->dv_parent;
struct tl_softc *tlsc = (struct tl_softc *)device_parent(self);
struct mii_attach_args *ma = aux;
struct mii_data *mii = ma->mii_data;
const struct mii_phydesc *mpd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp.c,v 1.23 2005/12/11 12:22:47 christos Exp $ */
/* $NetBSD: mscp.c,v 1.24 2006/03/25 23:20:18 thorpej Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.23 2005/12/11 12:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.24 2006/03/25 23:20:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -417,7 +417,7 @@ rwend:
bp->b_resid = bp->b_bcount - mp->mscp_seq.seq_bytecount;
bus_dmamap_unload(mi->mi_dmat, mxi->mxi_dmam);
(*mc->mc_ctlrdone)(mi->mi_dev.dv_parent);
(*mc->mc_ctlrdone)(device_parent(&mi->mi_dev));
(*me->me_iodone)(drive, bp);
out:
mxi->mxi_inuse = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_disk.c,v 1.49 2005/12/11 12:22:47 christos Exp $ */
/* $NetBSD: mscp_disk.c,v 1.50 2006/03/25 23:20:18 thorpej Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.49 2005/12/11 12:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.50 2006/03/25 23:20:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -382,7 +382,7 @@ rastrategy(bp)
b = splbio();
disk_busy(&ra->ra_disk);
splx(b);
mscp_strategy(bp, ra->ra_dev.dv_parent);
mscp_strategy(bp, device_parent(&ra->ra_dev));
return;
}
@ -405,7 +405,7 @@ rastrategy(bp)
b = splbio();
disk_busy(&ra->ra_disk);
splx(b);
mscp_strategy(bp, ra->ra_dev.dv_parent);
mscp_strategy(bp, device_parent(&ra->ra_dev));
return;
done:
@ -738,7 +738,8 @@ rx_putonline(rx)
struct rx_softc *rx;
{
struct mscp *mp;
struct mscp_softc *mi = (struct mscp_softc *)rx->ra_dev.dv_parent;
struct mscp_softc *mi =
(struct mscp_softc *)device_parent(&rx->ra_dev);
volatile int i;
rx->ra_state = DK_CLOSED;
@ -841,7 +842,7 @@ rxstrategy(bp)
b = splbio();
disk_busy(&rx->ra_disk);
splx(b);
mscp_strategy(bp, rx->ra_dev.dv_parent);
mscp_strategy(bp, device_parent(&rx->ra_dev));
return;
done:

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_subr.c,v 1.30 2005/12/11 12:22:47 christos Exp $ */
/* $NetBSD: mscp_subr.c,v 1.31 2006/03/25 23:20:18 thorpej Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.30 2005/12/11 12:22:47 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.31 2006/03/25 23:20:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -354,7 +354,7 @@ mscp_init(mi)
if (status == 0)
return 1; /* Init failed */
if (READ_SA & MP_ERR) {
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
(*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
return 1;
}
@ -363,7 +363,7 @@ mscp_init(mi)
MP_IE | (mi->mi_ivec >> 2));
status = mscp_waitstep(mi, STEP1MASK, STEP1GOOD);
if (status == 0) {
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
(*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
return 1;
}
@ -373,7 +373,7 @@ mscp_init(mi)
(vax_cputype == VAX_780 || vax_cputype == VAX_8600 ? MP_PI : 0));
status = mscp_waitstep(mi, STEP2MASK, STEP2GOOD(mi->mi_ivec >> 2));
if (status == 0) {
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
(*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
return 1;
}
@ -381,7 +381,7 @@ mscp_init(mi)
WRITE_SW((mi->mi_dmam->dm_segs[0].ds_addr >> 16));
status = mscp_waitstep(mi, STEP3MASK, STEP3GOOD);
if (status == 0) {
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
(*mi->mi_mc->mc_saerror)(device_parent(&mi->mi_dev), 0);
return 1;
}
i = READ_SA & 0377;
@ -544,7 +544,7 @@ mscp_kickaway(mi)
if ((mp = mscp_getcp(mi, MSCP_DONTWAIT)) == NULL) {
if (mi->mi_credits > MSCP_MINCREDITS)
printf("%s: command ring too small\n",
mi->mi_dev.dv_parent->dv_xname);
device_parent(&mi->mi_dev)->dv_xname);
/*
* By some (strange) reason we didn't get a MSCP packet.
* Just return and wait for free packets.
@ -568,7 +568,8 @@ mscp_kickaway(mi)
mi->mi_xi[next].mxi_inuse = 1;
bp->b_resid = next;
(*mi->mi_me->me_fillin)(bp, mp);
(*mi->mi_mc->mc_go)(mi->mi_dev.dv_parent, &mi->mi_xi[next]);
(*mi->mi_mc->mc_go)(device_parent(&mi->mi_dev),
&mi->mi_xi[next]);
(void)BUFQ_GET(mi->mi_resq);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mscp_tape.c,v 1.27 2006/03/07 04:45:52 matt Exp $ */
/* $NetBSD: mscp_tape.c,v 1.28 2006/03/25 23:20:18 thorpej Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.27 2006/03/07 04:45:52 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.28 2006/03/25 23:20:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -181,7 +181,8 @@ mt_putonline(mt)
struct mt_softc *mt;
{
struct mscp *mp;
struct mscp_softc *mi = (struct mscp_softc *)mt->mt_dev.dv_parent;
struct mscp_softc *mi =
(struct mscp_softc *)device_parent(&mt->mt_dev);
volatile int i;
((volatile struct mt_softc *) mt)->mt_state = MT_OFFLINE;
@ -280,7 +281,7 @@ mtstrategy(bp)
}
mt->mt_waswrite = bp->b_flags & B_READ ? 0 : 1;
mscp_strategy(bp, mt->mt_dev.dv_parent);
mscp_strategy(bp, device_parent(&mt->mt_dev));
return;
bad:
@ -496,7 +497,7 @@ mtcmd(mt, cmd, count, complete)
int cmd, count, complete;
{
struct mscp *mp;
struct mscp_softc *mi = (void *)mt->mt_dev.dv_parent;
struct mscp_softc *mi = (void *)device_parent(&mt->mt_dev);
volatile int i;
mp = mscp_getcp(mi, MSCP_WAIT);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mhzc.c,v 1.34 2005/12/11 12:23:23 christos Exp $ */
/* $NetBSD: mhzc.c,v 1.35 2006/03/25 23:23:26 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.34 2005/12/11 12:23:23 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mhzc.c,v 1.35 2006/03/25 23:23:26 thorpej Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -530,7 +530,7 @@ mhzc_em3336_enaddr(sc, myla)
{
/* Get the station address from CIS tuple 0x81. */
if (pcmcia_scan_cis(sc->sc_dev.dv_parent,
if (pcmcia_scan_cis(device_parent(&sc->sc_dev),
mhzc_em3336_lannid_ciscallback, myla) != 1) {
printf("%s: unable to get Ethernet address from CIS\n",
sc->sc_dev.dv_xname);
@ -720,7 +720,7 @@ com_mhzc_enable(sc)
struct com_softc *sc;
{
return (mhzc_enable((struct mhzc_softc *)sc->sc_dev.dv_parent,
return (mhzc_enable((struct mhzc_softc *)device_parent(&sc->sc_dev),
MHZC_MODEM_ENABLED));
}
@ -729,7 +729,7 @@ com_mhzc_disable(sc)
struct com_softc *sc;
{
mhzc_disable((struct mhzc_softc *)sc->sc_dev.dv_parent,
mhzc_disable((struct mhzc_softc *)device_parent(&sc->sc_dev),
MHZC_MODEM_ENABLED);
}
@ -793,7 +793,7 @@ sm_mhzc_enable(sc)
struct smc91cxx_softc *sc;
{
return (mhzc_enable((struct mhzc_softc *)sc->sc_dev.dv_parent,
return (mhzc_enable((struct mhzc_softc *)device_parent(&sc->sc_dev),
MHZC_ETHERNET_ENABLED));
}
@ -802,7 +802,7 @@ sm_mhzc_disable(sc)
struct smc91cxx_softc *sc;
{
mhzc_disable((struct mhzc_softc *)sc->sc_dev.dv_parent,
mhzc_disable((struct mhzc_softc *)device_parent(&sc->sc_dev),
MHZC_ETHERNET_ENABLED);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcmcom.c,v 1.25 2005/12/11 12:23:23 christos Exp $ */
/* $NetBSD: pcmcom.c,v 1.26 2006/03/25 23:23:26 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.25 2005/12/11 12:23:23 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcmcom.c,v 1.26 2006/03/25 23:23:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -382,7 +382,7 @@ com_pcmcom_enable(sc)
struct com_softc *sc;
{
return (pcmcom_enable((struct pcmcom_softc *)sc->sc_dev.dv_parent));
return (pcmcom_enable((struct pcmcom_softc *)device_parent(&sc->sc_dev)));
}
void
@ -390,6 +390,6 @@ com_pcmcom_disable(sc)
struct com_softc *sc;
{
pcmcom_disable((struct pcmcom_softc *)sc->sc_dev.dv_parent);
pcmcom_disable((struct pcmcom_softc *)device_parent(&sc->sc_dev));
}
#endif /* NCOM_PCMCOM > 0 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xirc.c,v 1.15 2005/12/11 12:23:23 christos Exp $ */
/* $NetBSD: xirc.c,v 1.16 2006/03/25 23:23:26 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.15 2005/12/11 12:23:23 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: xirc.c,v 1.16 2006/03/25 23:23:26 thorpej Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -640,7 +640,8 @@ int
com_xirc_enable(sc)
struct com_softc *sc;
{
struct xirc_softc *msc = (struct xirc_softc *)sc->sc_dev.dv_parent;
struct xirc_softc *msc =
(struct xirc_softc *)device_parent(&sc->sc_dev);
return (xirc_enable(msc, XIRC_MODEM_ENABLED, XIMEDIA_MODEM));
}
@ -649,7 +650,8 @@ void
com_xirc_disable(sc)
struct com_softc *sc;
{
struct xirc_softc *msc = (struct xirc_softc *)sc->sc_dev.dv_parent;
struct xirc_softc *msc =
(struct xirc_softc *)device_parent(&sc->sc_dev);
xirc_disable(msc, XIRC_MODEM_ENABLED, XIMEDIA_MODEM);
}
@ -704,8 +706,8 @@ xi_xirc_attach(parent, self, aux)
sc->sc_enable = xi_xirc_enable;
sc->sc_disable = xi_xirc_disable;
if (!pcmcia_scan_cis(msc->sc_dev.dv_parent, xi_xirc_lan_nid_ciscallback,
myla)) {
if (!pcmcia_scan_cis(device_parent(&msc->sc_dev),
xi_xirc_lan_nid_ciscallback, myla)) {
aprint_error("%s: can't find MAC address\n", self->dv_xname);
return;
}
@ -718,7 +720,8 @@ int
xi_xirc_enable(sc)
struct xi_softc *sc;
{
struct xirc_softc *msc = (struct xirc_softc *)sc->sc_dev.dv_parent;
struct xirc_softc *msc =
(struct xirc_softc *)device_parent(&sc->sc_dev);
return (xirc_enable(msc, XIRC_ETHERNET_ENABLED, XIMEDIA_ETHER));
}
@ -727,7 +730,8 @@ void
xi_xirc_disable(sc)
struct xi_softc *sc;
{
struct xirc_softc *msc = (struct xirc_softc *)sc->sc_dev.dv_parent;
struct xirc_softc *msc =
(struct xirc_softc *)device_parent(&sc->sc_dev);
xirc_disable(msc, XIRC_ETHERNET_ENABLED, XIMEDIA_ETHER);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: uda.c,v 1.54 2006/02/27 03:00:33 thorpej Exp $ */
/* $NetBSD: uda.c,v 1.55 2006/03/25 23:24:19 thorpej Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.54 2006/02/27 03:00:33 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.55 2006/03/25 23:24:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -417,7 +417,7 @@ udaintr(void *arg)
* Handle buffer purge requests.
* XXX - should be done in bus_dma_sync().
*/
uh = (void *)sc->sc_dev.dv_parent;
uh = (void *)device_parent(&sc->sc_dev);
#ifdef notyet
if (ud->mp_ca.ca_bdp) {
if (uh->uh_ubapurge)
@ -468,6 +468,6 @@ udactlrdone(struct device *usc)
int s;
s = spluba();
uba_done((struct uba_softc *)sc->sc_dev.dv_parent);
uba_done((struct uba_softc *)device_parent(&sc->sc_dev));
splx(s);
}