mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 20:53:53 +08:00
regmap: Skip read-only registers in regcache_sync()
regcache_sync() spews warnings when a value was cached for a read-only register as it tries to write all registers no matter whether they are writable or not. This patch adds regmap_wrtieable() checks for avoiding it in regcache_sync_block_single() and regcache_block_raw(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c517d838eb
commit
4ceba98d3f
@ -608,7 +608,8 @@ static int regcache_sync_block_single(struct regmap *map, void *block,
|
|||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; i++) {
|
||||||
regtmp = block_base + (i * map->reg_stride);
|
regtmp = block_base + (i * map->reg_stride);
|
||||||
|
|
||||||
if (!regcache_reg_present(cache_present, i))
|
if (!regcache_reg_present(cache_present, i) ||
|
||||||
|
!regmap_writeable(map, regtmp))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
val = regcache_get_val(map, block, i);
|
val = regcache_get_val(map, block, i);
|
||||||
@ -677,7 +678,8 @@ static int regcache_sync_block_raw(struct regmap *map, void *block,
|
|||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; i++) {
|
||||||
regtmp = block_base + (i * map->reg_stride);
|
regtmp = block_base + (i * map->reg_stride);
|
||||||
|
|
||||||
if (!regcache_reg_present(cache_present, i)) {
|
if (!regcache_reg_present(cache_present, i) ||
|
||||||
|
!regmap_writeable(map, regtmp)) {
|
||||||
ret = regcache_sync_block_raw_flush(map, &data,
|
ret = regcache_sync_block_raw_flush(map, &data,
|
||||||
base, regtmp);
|
base, regtmp);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user