summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorArun Chandran <achandran@mvista.com>2015-06-15 15:59:02 +0530
committerSasha Levin <sasha.levin@oracle.com>2015-07-03 23:02:30 -0400
commitbef8c3f0d1b428d4231106f3fa10b7e40b950ea3 (patch)
tree5114f779ee653890c48c1ceee3d1513c4a4058d8 /drivers/base
parentc84ed5e549f31ce4567a601702ce9af94826ea7b (diff)
regmap: Fix regmap_bulk_read in BE mode
[ Upstream commit 15b8d2c41fe5839582029f65c5f7004db451cc2b ] 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> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
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 ee731bb7d957..a434df6d4e09 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2317,7 +2317,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);
}
}