mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
regmap: cache: Return error in cache sync operations for REGCACHE_NONE
[ Upstream commit fd883d79e4 ]
There is no sense in doing a cache sync on REGCACHE_NONE regmaps.
Instead of panicking the kernel due to missing cache_ops, return an error
to client driver.
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20230313071812.13577-1-alexander.stein@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
34813f041d
commit
10add04ee6
@@ -349,6 +349,9 @@ int regcache_sync(struct regmap *map)
|
|||||||
const char *name;
|
const char *name;
|
||||||
bool bypass;
|
bool bypass;
|
||||||
|
|
||||||
|
if (WARN_ON(map->cache_type == REGCACHE_NONE))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
BUG_ON(!map->cache_ops);
|
BUG_ON(!map->cache_ops);
|
||||||
|
|
||||||
map->lock(map->lock_arg);
|
map->lock(map->lock_arg);
|
||||||
@@ -418,6 +421,9 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
|
|||||||
const char *name;
|
const char *name;
|
||||||
bool bypass;
|
bool bypass;
|
||||||
|
|
||||||
|
if (WARN_ON(map->cache_type == REGCACHE_NONE))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
BUG_ON(!map->cache_ops);
|
BUG_ON(!map->cache_ops);
|
||||||
|
|
||||||
map->lock(map->lock_arg);
|
map->lock(map->lock_arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user