aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-06-15 19:50:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-06-15 19:50:57 -0700
commit231a1e31574e3584cd2c297c98a5afb364715b3a (patch)
treeb11f28e6adc9c2be39eddfb4a340d7bf51d6da2d
parentc926a55f650ce58eae33cda504d50ac1837d53fd (diff)
parent44e46572f0bae431a6092e3cfd2f47bff8b8d18c (diff)
downloadlinux-231a1e31574e3584cd2c297c98a5afb364715b3a.tar.gz
Merge tag 'regmap-fix-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fix from Mark Brown: "Another fix for the maple tree cache, Takashi noticed that unlike other caches the maple tree cache didn't check for read only registers before trying to sync which would result in spurious syncs for read only registers where we don't have a default. This was due to the check being open coded in the caches, we now check in the shared 'does this register need sync' function so that is fixed for this and future caches" * tag 'regmap-fix-v6.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: regcache: Don't sync read-only registers
-rw-r--r--drivers/base/regmap/regcache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 029564695dbbb1..97c681fcf9f6ee 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -284,6 +284,9 @@ static bool regcache_reg_needs_sync(struct regmap *map, unsigned int reg,
{
int ret;
+ if (!regmap_writeable(map, reg))
+ return false;
+
/* If we don't know the chip just got reset, then sync everything. */
if (!map->no_sync_defaults)
return true;