regmap: fix page selection for noinc writes
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 17 Sep 2020 15:34:05 +0000 (18:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:30 +0000 (17:36 +0200)
commit93e864762dcb718892803f67f824b2646403a436
tree678932808e5ac2f7fd3e1b7a666238d6a80f403e
parentde74a520081f1bab78ae7e017d59ea30078bc630
regmap: fix page selection for noinc writes

[ Upstream commit 05669b63170771d554854c0e465b76dc98fc7c84 ]

Non-incrementing writes can fail if register + length crosses page
border. However for non-incrementing writes we should not check for page
border crossing. Fix this by passing additional flag to _regmap_raw_write
and passing length to _regmap_select_page basing on the flag.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: cdf6b11daa77 ("regmap: Add regmap_noinc_write API")
Link: https://lore.kernel.org/r/20200917153405.3139200-2-dmitry.baryshkov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap.c