diff options
author | phk <phk@FreeBSD.org> | 2007-04-17 17:32:39 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2007-04-17 17:32:39 +0000 |
commit | f0a8f88e532b914ad68f0db198a54742e4e28c27 (patch) | |
tree | 415a553c78fda77edc0f866d34b8dcbde9bc7148 /sys/dev | |
parent | 708ec25681ba4539b2161e56169de23fbc01d262 (diff) | |
download | FreeBSD-src-f0a8f88e532b914ad68f0db198a54742e4e28c27.zip FreeBSD-src-f0a8f88e532b914ad68f0db198a54742e4e28c27.tar.gz |
No need to throw tag+handle around on the stack.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/vr/if_vr.c | 3 | ||||
-rw-r--r-- | sys/dev/vr/if_vrreg.h | 22 |
2 files changed, 7 insertions, 18 deletions
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index d657634..d45c850 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -689,9 +689,6 @@ vr_attach(dev) goto fail; } - sc->vr_btag = rman_get_bustag(sc->vr_res); - sc->vr_bhandle = rman_get_bushandle(sc->vr_res); - /* Allocate interrupt */ rid = 0; sc->vr_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, diff --git a/sys/dev/vr/if_vrreg.h b/sys/dev/vr/if_vrreg.h index b1baca9..3cd4176 100644 --- a/sys/dev/vr/if_vrreg.h +++ b/sys/dev/vr/if_vrreg.h @@ -455,8 +455,6 @@ struct vr_mii_frame { struct vr_softc { struct ifnet *vr_ifp; /* interface info */ device_t vr_dev; - bus_space_handle_t vr_bhandle; /* bus space handle */ - bus_space_tag_t vr_btag; /* bus space tag */ struct resource *vr_res; struct resource *vr_irq; void *vr_intrhand; @@ -485,19 +483,13 @@ struct vr_softc { /* * register space access macros */ -#define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->vr_btag, sc->vr_bhandle, reg, val) -#define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->vr_btag, sc->vr_bhandle, reg, val) -#define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->vr_btag, sc->vr_bhandle, reg, val) - -#define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->vr_btag, sc->vr_bhandle, reg) -#define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->vr_btag, sc->vr_bhandle, reg) -#define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->vr_btag, sc->vr_bhandle, reg) +#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->vr_res, reg, val) +#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->vr_res, reg, val) +#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->vr_res, reg, val) + +#define CSR_READ_4(sc, reg) bus_read_4(sc->vr_res, reg) +#define CSR_READ_2(sc, reg) bus_read_2(sc->vr_res, reg) +#define CSR_READ_1(sc, reg) bus_read_1(sc->vr_res, reg) #define VR_TIMEOUT 1000 #define ETHER_ALIGN 2 |