Fixes a bootstrapping issue for some registers when a less commonly used method for register cache initialisation is used. Only affects a fairly small proportion of users that both don't use explicit register defaults and do use the cache. * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Fix cache defaults initialization from raw cache defaults
Unified · Split
| @@ -53,7 +53,7 @@ static int regcache_hw_init(struct regmap *map) · 52 unmodified lines | ||
| 53 | 53 | for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++) { |
| 54 | 54 | val = regcache_get_val(map->reg_defaults_raw, |
| 55 | 55 | i, map->cache_word_size); |
| 56 | − if (!val) | |
| 56 | + if (regmap_volatile(map, i)) | |
| 57 | 57 | continue; |
| 58 | 58 | count++; |
| 59 | 59 | } |
| @@ -70,7 +70,7 @@ static int regcache_hw_init(struct regmap *map) · 10 unmodified lines | ||
| 70 | 70 | for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) { |
| 71 | 71 | val = regcache_get_val(map->reg_defaults_raw, |
| 72 | 72 | i, map->cache_word_size); |
| 73 | − if (!val) | |
| 73 | + if (regmap_volatile(map, i)) | |
| 74 | 74 | continue; |
| 75 | 75 | map->reg_defaults[j].reg = i; |
| 76 | 76 | map->reg_defaults[j].def = val; |