diff options
Diffstat (limited to 'sys/arch/sparc64/dev/beeper.c')
| -rw-r--r-- | sys/arch/sparc64/dev/beeper.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/arch/sparc64/dev/beeper.c b/sys/arch/sparc64/dev/beeper.c index b87e7144b0e..b8386f34bec 100644 --- a/sys/arch/sparc64/dev/beeper.c +++ b/sys/arch/sparc64/dev/beeper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: beeper.c,v 1.6 2002/08/19 20:19:13 jason Exp $ */ +/* $OpenBSD: beeper.c,v 1.7 2003/02/17 01:29:19 henric Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -108,12 +108,16 @@ beeper_attach(parent, self, aux) struct beeper_softc *sc = (void *)self; struct ebus_attach_args *ea = aux; - sc->sc_iot = ea->ea_bustag; + sc->sc_iot = ea->ea_iotag; /* Use prom address if available, otherwise map it. */ - if (ea->ea_nvaddrs) - sc->sc_ioh = (bus_space_handle_t)ea->ea_vaddrs[0]; - else if (ebus_bus_map(sc->sc_iot, 0, + if (ea->ea_nvaddrs) { + if (bus_space_map(sc->sc_iot, ea->ea_vaddrs[0], 0, + BUS_SPACE_MAP_PROMADDRESS, &sc->sc_ioh)) { + printf(": can't map PROM register space\n"); + return; + } + } else if (ebus_bus_map(sc->sc_iot, 0, EBUS_PADDR_FROM_REG(&ea->ea_regs[0]), ea->ea_regs[0].size, BUS_SPACE_MAP_LINEAR, 0, &sc->sc_ioh) != 0) { printf(": can't map register space\n"); |
