diff options
author | marius <marius@FreeBSD.org> | 2005-12-03 18:11:26 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2005-12-03 18:11:26 +0000 |
commit | 1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932 (patch) | |
tree | 40e0c87be96fddaf2b7db76031fd15927225832e /sys/sparc64/pci/ofw_pcib_subr.c | |
parent | 865e779b5d6ed4275a000576a9d4af4bf4b52706 (diff) | |
download | FreeBSD-src-1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932.zip FreeBSD-src-1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932.tar.gz |
- Adhere style(9) (don't use function calls in initializers, use uintXX_t
instead of u_intXX_t).
- Use FBSDID.
Diffstat (limited to 'sys/sparc64/pci/ofw_pcib_subr.c')
-rw-r--r-- | sys/sparc64/pci/ofw_pcib_subr.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/sys/sparc64/pci/ofw_pcib_subr.c b/sys/sparc64/pci/ofw_pcib_subr.c index b297d34..80f6d5f 100644 --- a/sys/sparc64/pci/ofw_pcib_subr.c +++ b/sys/sparc64/pci/ofw_pcib_subr.c @@ -21,10 +21,11 @@ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include "opt_ofw_pci.h" #include <sys/param.h> @@ -50,9 +51,10 @@ void ofw_pcib_gen_setup(device_t bridge) { - struct ofw_pcib_gen_softc *sc = device_get_softc(bridge); + struct ofw_pcib_gen_softc *sc; u_int secbus; + sc = device_get_softc(bridge); sc->ops_pcib_sc.dev = bridge; sc->ops_node = ofw_bus_get_node(bridge); KASSERT(sc->ops_node != 0, @@ -78,18 +80,19 @@ ofw_pcib_gen_setup(device_t bridge) int ofw_pcib_gen_route_interrupt(device_t bridge, device_t dev, int intpin) { - struct ofw_pcib_gen_softc *sc = device_get_softc(bridge); - struct ofw_bus_iinfo *ii = &sc->ops_iinfo; + struct ofw_pcib_gen_softc *sc; + struct ofw_bus_iinfo *ii; struct ofw_pci_register reg; - device_t pbridge = device_get_parent(device_get_parent(bridge)); - phandle_t node = ofw_bus_get_node(dev); ofw_pci_intr_t pintr, mintr; - u_int8_t maskbuf[sizeof(reg) + sizeof(pintr)]; + uint8_t maskbuf[sizeof(reg) + sizeof(pintr)]; + sc = device_get_softc(bridge); + ii = &sc->ops_iinfo; if (ii->opi_imapsz > 0) { pintr = intpin; - if (ofw_bus_lookup_imap(node, ii, ®, sizeof(reg), &pintr, - sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) { + if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, ®, + sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr), + maskbuf)) { /* * If we've found a mapping, return it and don't map * it again on higher levels - that causes problems @@ -105,22 +108,25 @@ ofw_pcib_gen_route_interrupt(device_t bridge, device_t dev, int intpin) return (pcib_route_interrupt(bridge, dev, intpin)); } /* Try at the parent. */ - return (PCIB_ROUTE_INTERRUPT(pbridge, bridge, intpin)); + return (PCIB_ROUTE_INTERRUPT(device_get_parent(bridge), bridge, + intpin)); } phandle_t ofw_pcib_gen_get_node(device_t bridge, device_t dev) { - struct ofw_pcib_gen_softc *sc = device_get_softc(bridge); + struct ofw_pcib_gen_softc *sc; + sc = device_get_softc(bridge); return (sc->ops_node); } void ofw_pcib_gen_adjust_busrange(device_t bridge, u_int subbus) { - struct ofw_pcib_gen_softc *sc = device_get_softc(bridge); + struct ofw_pcib_gen_softc *sc; + sc = device_get_softc(bridge); if (subbus > sc->ops_pcib_sc.subbus) { #ifdef OFW_PCI_DEBUG device_printf(bridge, |