summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorArun Chandran <achandran@mvista.com>2015-06-15 15:59:02 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-03 09:29:51 -0700
commit97e83aca6ed024ddeb15d04696a40fa694a3e445 (patch)
tree18cb5878f1fc6df7bc967657a0b8efc33f122bf5 /drivers/base
parentdff5d6ed2aa052706a6cb877aa27f4c6b9e70f05 (diff)
regmap: Fix regmap_bulk_read in BE mode
commit 15b8d2c41fe5839582029f65c5f7004db451cc2b upstream. In big endian mode regmap_bulk_read gives incorrect data for byte reads. This is because memcpy of a single byte from an address after full word read gives different results when endianness differs. ie. we get little-end in LE and big-end in BE. Signed-off-by: Arun Chandran <achandran@mvista.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 2f9a3d8ecbbf..8f824622cf4b 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1947,7 +1947,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
&ival);
if (ret != 0)
return ret;
- memcpy(val + (i * val_bytes), &ival, val_bytes);
+ map->format.format_val(val + (i * val_bytes), ival, 0);
}
}