Deleted Added
full compact
31c31
< __FBSDID("$FreeBSD: head/sys/dev/cfi/cfi_core.c 193936 2009-06-10 17:41:24Z imp $");
---
> __FBSDID("$FreeBSD: head/sys/dev/cfi/cfi_core.c 233553 2012-03-27 15:13:12Z jchandra $");
38a39
> #include <sys/endian.h>
57c58
< cfi_read(struct cfi_softc *sc, u_int ofs)
---
> cfi_read_raw(struct cfi_softc *sc, u_int ofs)
78a80,105
> uint32_t
> cfi_read(struct cfi_softc *sc, u_int ofs)
> {
> uint32_t val;
> uint16_t sval;
>
> ofs &= ~(sc->sc_width - 1);
> switch (sc->sc_width) {
> case 1:
> val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs);
> break;
> case 2:
> sval = bus_space_read_2(sc->sc_tag, sc->sc_handle, ofs);
> val = le16toh(sval);
> break;
> case 4:
> val = bus_space_read_4(sc->sc_tag, sc->sc_handle, ofs);
> val = le32toh(val);
> break;
> default:
> val = ~0;
> break;
> }
> return (val);
> }
>
89c116
< bus_space_write_2(sc->sc_tag, sc->sc_handle, ofs, val);
---
> bus_space_write_2(sc->sc_tag, sc->sc_handle, ofs, htole16(val));
92c119
< bus_space_write_4(sc->sc_tag, sc->sc_handle, ofs, val);
---
> bus_space_write_4(sc->sc_tag, sc->sc_handle, ofs, htole32(val));