diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-02 10:36:48 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-11-02 10:36:48 +0000 |
commit | 3ef9fe8a9a1f9530b4fea9e825fcea703d2b02c4 (patch) | |
tree | 98757273ffd2f35c59856a1a2dd325333914780e /sys/arch | |
parent | 9bd1a9fbfe3fc64b6c253afd4aec9a128906207f (diff) |
use correct array index when setting frequency
ok miod@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/beep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/sparc64/dev/beep.c b/sys/arch/sparc64/dev/beep.c index 0e535271d74..28f6a5609a8 100644 --- a/sys/arch/sparc64/dev/beep.c +++ b/sys/arch/sparc64/dev/beep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: beep.c,v 1.11 2022/10/16 01:22:39 jsg Exp $ */ +/* $OpenBSD: beep.c,v 1.12 2024/11/02 10:36:47 jsg Exp $ */ /* * Copyright (c) 2006 Jason L. Wright (jason@thought.net) @@ -188,13 +188,13 @@ beep_setfreq(struct beep_softc *sc, int freq) selected = 0; bus_space_write_1(sc->sc_iot, sc->sc_ioh, BEEP_CNT_0, - (sc->sc_freqs[i].reg >> 24) & 0xff); + (sc->sc_freqs[selected].reg >> 24) & 0xff); bus_space_write_1(sc->sc_iot, sc->sc_ioh, BEEP_CNT_1, - (sc->sc_freqs[i].reg >> 16) & 0xff); + (sc->sc_freqs[selected].reg >> 16) & 0xff); bus_space_write_1(sc->sc_iot, sc->sc_ioh, BEEP_CNT_2, - (sc->sc_freqs[i].reg >> 8) & 0xff); + (sc->sc_freqs[selected].reg >> 8) & 0xff); bus_space_write_1(sc->sc_iot, sc->sc_ioh, BEEP_CNT_3, - (sc->sc_freqs[i].reg >> 0) & 0xff); + (sc->sc_freqs[selected].reg >> 0) & 0xff); } #if NHIDKBD > 0 |