linux/drivers/base/regmap
Charles Keepax d7e412b847 regmap: Don't use format_val in regmap_bulk_read
commit 9ae27a8d1f upstream.

A bulk read can be implemented either through regmap_raw_read, or
by reading each register individually using regmap_read.  Both
regmap_read and regmap_bulk_read should return values in native
endian. In the individual case the current implementation calls
format_val to put the data into the output array, which can cause
endian issues. The regmap_read will have already converted the data
into native endian, if the hosts endian differs from the device then
format_val will switch the endian back again.

Rather than using format_val simply use the code that is called if
there is no format_val function. This code supports all cases except
24-bit but there don't appear to be any users of regmap_bulk_read for
24-bit. Additionally, it would have to be a big endian host for the
old code to actually function correctly anyway.

Fixes: 15b8d2c41f ("regmap: Fix regmap_bulk_read in BE mode")
Reported-by: David Rhodes <david.rhodes@cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
[bwh: Backported to 3.16:
 - 64-bit I/O is not supported
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:44:46 +01:00
..
internal.h regmap: introduce regmap_name to fix syscon regmap trace events 2015-04-10 10:03:57 +01:00
Kconfig regmap: add SPMI support 2013-10-28 12:51:43 -07:00
Makefile regmap: add SPMI support 2013-10-28 12:51:43 -07:00
regcache-flat.c regmap: flat: Add flat cache type 2013-01-02 10:58:53 +00:00
regcache-lzo.c regmap: cache: Remove unused 'blksize' variable 2017-03-16 02:26:25 +00:00
regcache-rbtree.c regmap: regcache-rbtree: Clean new present bits on present bitmap resize 2015-08-31 14:14:07 +01:00
regcache.c regmap: cache: Fix typo in cache_bypass parameter description 2016-08-22 22:37:47 +01:00
regmap-debugfs.c regmap: debugfs: Don't bother actually printing when calculating max length 2015-10-30 13:59:26 +00:00
regmap-i2c.c regmap: i2c: fallback to SMBus if the adapter does not support standard I2C 2014-04-22 12:57:28 +01:00
regmap-irq.c regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. 2014-05-26 16:37:04 +01:00
regmap-mmio.c Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic/mmio' and 'regmap/topic/rbtree' into regmap-next 2014-06-02 17:07:39 +01:00
regmap-spi.c drivers/base: delete non-required instances of include <linux/init.h> 2014-02-14 14:31:37 -08:00
regmap-spmi.c regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case 2016-06-15 21:29:24 +01:00
regmap.c regmap: Don't use format_val in regmap_bulk_read 2018-10-21 08:44:46 +01:00