mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
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:
parent
86fc3483a4
commit
afc8e3ee83
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user