regcache: Validate cache_only state in regcache_sync_region()

Add a WARN_ON() check to ensure regcache_sync_region() is not called
while cache_only is enabled.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260720033238.52479-2-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
bui duc phuc 2026-07-20 10:32:38 +07:00 committed by Mark Brown
parent 86fc3483a4
commit afc8e3ee83
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -516,6 +516,10 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
map->lock(map->lock_arg);
if (WARN_ON(map->cache_only)) {
map->unlock(map->lock_arg);
return -EINVAL;
}
/* Remember the initial bypass state */
bypass = map->cache_bypass;