From 9313bae41dc616f95d10f59b955e81b0262293f4 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Sat, 7 Feb 2009 05:32:19 +0000 Subject: [PATCH] fix building w/o CFI_ARMEDANDDANGEROUS --- sys/dev/cfi/cfi_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c index b19d27103f54..a31db5cc8dd9 100644 --- a/sys/dev/cfi/cfi_core.c +++ b/sys/dev/cfi/cfi_core.c @@ -450,11 +450,13 @@ cfi_get16(struct cfi_softc *sc, int off) return v; } +#ifdef CFI_ARMEDANDDANGEROUS static void cfi_put16(struct cfi_softc *sc, int off, uint16_t v) { bus_space_write_2(sc->sc_tag, sc->sc_handle, off<<1, v); } +#endif /* * Read the factory-defined 64-bit segment of the PR. @@ -556,9 +558,8 @@ cfi_intel_set_plr(struct cfi_softc *sc) { #ifdef CFI_ARMEDANDDANGEROUS register_t intr; -#endif int error; - +#endif if (sc->sc_cmdset != CFI_VEND_INTEL_ECS) return EOPNOTSUPP; KASSERT(sc->sc_width == 2, ("sc_width %d", sc->sc_width)); @@ -572,11 +573,11 @@ cfi_intel_set_plr(struct cfi_softc *sc) intr_restore(intr); error = cfi_wait_ready(sc, CFI_BCS_READ_STATUS, sc->sc_write_timeout); cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + return error; #else device_printf(sc->sc_dev, "%s: PLR not set, " "CFI_ARMEDANDDANGEROUS not configured\n", __func__); - error = ENXIO; + return ENXIO; #endif - return error; } #endif /* CFI_SUPPORT_STRATAFLASH */