diff options
author | Victor Kamensky <victor.kamensky@linaro.org> | 2013-07-29 22:03:27 -0700 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2013-11-18 10:14:43 +0100 |
commit | 47d39bd8eb333068a7a4ea08880f6d704200f429 (patch) | |
tree | 80e96fae3bbcb54aca1cc171d30c3a030ee1d74e /include | |
parent | 69ca04178ff55144c011a4789a040a81723f3c02 (diff) |
mtd: map.h endian fix
Need to use endian neutral functions to read/write LE h/w registers. I.e
insted of __raw_readl and _raw_writel, readl_relaxed and writel_relaxed. If
the first just read/write register with memory barrier, the second will
byteswap it if host operates in BE mode.
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/map.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 4b02512e421c..b760cb417ccb 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -397,11 +397,11 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) map_word r; if (map_bankwidth_is_1(map)) - r.x[0] = __raw_readb(map->virt + ofs); + r.x[0] = readb_relaxed(map->virt + ofs); else if (map_bankwidth_is_2(map)) - r.x[0] = __raw_readw(map->virt + ofs); + r.x[0] = readw_relaxed(map->virt + ofs); else if (map_bankwidth_is_4(map)) - r.x[0] = __raw_readl(map->virt + ofs); + r.x[0] = readl_relaxed(map->virt + ofs); #if BITS_PER_LONG >= 64 else if (map_bankwidth_is_8(map)) r.x[0] = __raw_readq(map->virt + ofs); @@ -417,11 +417,11 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) static inline void inline_map_write(struct map_info *map, const map_word datum, unsigned long ofs) { if (map_bankwidth_is_1(map)) - __raw_writeb(datum.x[0], map->virt + ofs); + writeb_relaxed(datum.x[0], map->virt + ofs); else if (map_bankwidth_is_2(map)) - __raw_writew(datum.x[0], map->virt + ofs); + writew_relaxed(datum.x[0], map->virt + ofs); else if (map_bankwidth_is_4(map)) - __raw_writel(datum.x[0], map->virt + ofs); + writel_relaxed(datum.x[0], map->virt + ofs); #if BITS_PER_LONG >= 64 else if (map_bankwidth_is_8(map)) __raw_writeq(datum.x[0], map->virt + ofs); |