]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regmap: Format data for raw write in regmap_bulk_write
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 22 Feb 2018 12:59:10 +0000 (12:59 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 26 Feb 2018 11:00:30 +0000 (11:00 +0000)
commit0812d8ffa9955251ba0077488d4408d8987ec091
tree8c2fc9f9cae2b6690684b85002eeb1c77c5f996f
parent2936e846c4e6df2df0dd6bcade3d269e17a707d1
regmap: Format data for raw write in regmap_bulk_write

In the case were the bulk transaction is split up into smaller chunks
data is passed directly to regmap_raw_write. However regmap_bulk_write
uses data in host endian and regmap_raw_write expects data in device
endian. As such if the host and device differ in endian the wrong data
will be written to the device. Correct this issue using a similar
approach to the single raw write case below it, duplicate the data
into a new buffer and use parse_inplace to format the data correctly.

Fixes: adaac459759d ("regmap: Introduce max_raw_read/write for regmap_bulk_read/write")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/regmap.c