Use device_parent().CVS: ----------------------------------------------------------------------

This commit is contained in:
thorpej 2006-03-25 22:55:05 +00:00
parent 843592e4df
commit 04da529aa3
3 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_cardbus.c,v 1.15 2005/12/11 12:21:15 christos Exp $ */
/* $NetBSD: com_cardbus.c,v 1.16 2006/03/25 22:55:05 thorpej Exp $ */
/*
* Copyright (c) 2000 Johan Danielsson
@ -40,7 +40,7 @@
updated below. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.15 2005/12/11 12:21:15 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: com_cardbus.c,v 1.16 2006/03/25 22:55:05 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -295,7 +295,7 @@ com_cardbus_enable(struct com_softc *sc)
{
struct com_cardbus_softc *csc = (struct com_cardbus_softc*)sc;
struct cardbus_softc *psc =
(struct cardbus_softc *)sc->sc_dev.dv_parent;
(struct cardbus_softc *)device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
@ -323,7 +323,7 @@ com_cardbus_disable(struct com_softc *sc)
{
struct com_cardbus_softc *csc = (struct com_cardbus_softc*)sc;
struct cardbus_softc *psc =
(struct cardbus_softc *)sc->sc_dev.dv_parent;
(struct cardbus_softc *)device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
@ -338,7 +338,7 @@ com_cardbus_detach(struct device *self, int flags)
{
struct com_cardbus_softc *csc = (struct com_cardbus_softc *) self;
struct com_softc *sc = (struct com_softc *) self;
struct cardbus_softc *psc = (struct cardbus_softc *)self->dv_parent;
struct cardbus_softc *psc = (struct cardbus_softc *)device_parent(self);
int error;
if ((error = com_detach(self, flags)) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_fxp_cardbus.c,v 1.21 2005/12/11 12:21:15 christos Exp $ */
/* $NetBSD: if_fxp_cardbus.c,v 1.22 2006/03/25 22:55:05 thorpej Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.21 2005/12/11 12:21:15 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_fxp_cardbus.c,v 1.22 2006/03/25 22:55:05 thorpej Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
@ -196,7 +196,7 @@ fxp_cardbus_setup(struct fxp_softc * sc)
{
struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *) sc;
struct cardbus_softc *psc =
(struct cardbus_softc *) sc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
pcireg_t command;
@ -230,7 +230,7 @@ fxp_cardbus_enable(struct fxp_softc * sc)
{
struct fxp_cardbus_softc *csc = (struct fxp_cardbus_softc *) sc;
struct cardbus_softc *psc =
(struct cardbus_softc *) sc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
@ -258,7 +258,7 @@ static void
fxp_cardbus_disable(struct fxp_softc * sc)
{
struct cardbus_softc *psc =
(struct cardbus_softc *) sc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rbus_ppb.c,v 1.17 2005/12/11 12:21:15 christos Exp $ */
/* $NetBSD: rbus_ppb.c,v 1.18 2006/03/25 22:55:05 thorpej Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.17 2005/12/11 12:21:15 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: rbus_ppb.c,v 1.18 2006/03/25 22:55:05 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -660,7 +660,7 @@ ppb_cardbus_attach(parent, self, aux)
{
struct ppb_cardbus_softc *csc = (struct ppb_cardbus_softc *) self;
struct cardbus_softc *parent_sc =
(struct cardbus_softc *) csc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&csc->sc_dev);
struct cardbus_attach_args *ca = aux;
cardbus_devfunc_t ct = ca->ca_ct;
cardbus_chipset_tag_t cc = ct->ct_cc;
@ -812,7 +812,7 @@ ppb_cardbus_enable(struct ppb_softc * sc)
#if 0
struct ppb_cardbus_softc *csc = (struct fxp_cardbus_softc *) sc;
struct cardbus_softc *psc =
(struct cardbus_softc *) sc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;
@ -842,7 +842,7 @@ ppb_cardbus_disable(struct ppb_softc * sc)
{
#if 0
struct cardbus_softc *psc =
(struct cardbus_softc *) sc->sc_dev.dv_parent;
(struct cardbus_softc *) device_parent(&sc->sc_dev);
cardbus_chipset_tag_t cc = psc->sc_cc;
cardbus_function_tag_t cf = psc->sc_cf;