Merge remote-tracking branch 'regmap/topic/cache' into regmap-rbtree
This commit is contained in:
Коммит
65c180fd95
|
@ -223,7 +223,7 @@ int regcache_set_reg_present(struct regmap *map, unsigned int reg);
|
||||||
static inline bool regcache_reg_present(struct regmap *map, unsigned int reg)
|
static inline bool regcache_reg_present(struct regmap *map, unsigned int reg)
|
||||||
{
|
{
|
||||||
if (!map->cache_present)
|
if (!map->cache_present)
|
||||||
return true;
|
return false;
|
||||||
if (reg > map->cache_present_nbits)
|
if (reg > map->cache_present_nbits)
|
||||||
return false;
|
return false;
|
||||||
return map->cache_present[BIT_WORD(reg)] & BIT_MASK(reg);
|
return map->cache_present[BIT_WORD(reg)] & BIT_MASK(reg);
|
||||||
|
|
|
@ -241,9 +241,6 @@ int regcache_write(struct regmap *map,
|
||||||
|
|
||||||
BUG_ON(!map->cache_ops);
|
BUG_ON(!map->cache_ops);
|
||||||
|
|
||||||
if (!regmap_writeable(map, reg))
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
if (!regmap_volatile(map, reg))
|
if (!regmap_volatile(map, reg))
|
||||||
return map->cache_ops->write(map, reg, value);
|
return map->cache_ops->write(map, reg, value);
|
||||||
|
|
||||||
|
|
|
@ -1261,6 +1261,9 @@ int _regmap_write(struct regmap *map, unsigned int reg,
|
||||||
int ret;
|
int ret;
|
||||||
void *context = _regmap_map_get_context(map);
|
void *context = _regmap_map_get_context(map);
|
||||||
|
|
||||||
|
if (!regmap_writeable(map, reg))
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
if (!map->cache_bypass && !map->defer_caching) {
|
if (!map->cache_bypass && !map->defer_caching) {
|
||||||
ret = regcache_write(map, reg, val);
|
ret = regcache_write(map, reg, val);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче