From ec89b8a856d8f414c064133c6338d0121fdeb8ab Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Tue, 22 Dec 2009 21:44:25 +0000 Subject: [PATCH] Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to bus_space_write_{1,2,4}/bus_space_read_{1,2,4}. Remove unused ste_bhandle and ste_btag in softc. --- sys/dev/ste/if_ste.c | 3 --- sys/dev/ste/if_stereg.h | 14 ++++++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/dev/ste/if_ste.c b/sys/dev/ste/if_ste.c index 3faf0d0b2277..e8dfc83fc2ef 100644 --- a/sys/dev/ste/if_ste.c +++ b/sys/dev/ste/if_ste.c @@ -972,9 +972,6 @@ ste_attach(device_t dev) goto fail; } - sc->ste_btag = rman_get_bustag(sc->ste_res); - sc->ste_bhandle = rman_get_bushandle(sc->ste_res); - /* Allocate interrupt */ rid = 0; sc->ste_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, diff --git a/sys/dev/ste/if_stereg.h b/sys/dev/ste/if_stereg.h index 081b872ba158..c0adcad7f21c 100644 --- a/sys/dev/ste/if_stereg.h +++ b/sys/dev/ste/if_stereg.h @@ -465,18 +465,18 @@ struct ste_desc_onefrag { * register space access macros */ #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_4((sc)->ste_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_2((sc)->ste_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->ste_btag, sc->ste_bhandle, reg, val) + bus_write_1((sc)->ste_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_4((sc)->ste_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_2((sc)->ste_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->ste_btag, sc->ste_bhandle, reg) + bus_read_1((sc)->ste_res, reg) #define STE_DESC_ALIGN 8 #define STE_RX_LIST_CNT 128 @@ -544,8 +544,6 @@ struct ste_chain_data { struct ste_softc { struct ifnet *ste_ifp; - bus_space_tag_t ste_btag; - bus_space_handle_t ste_bhandle; struct resource *ste_res; int ste_res_id; int ste_res_type;