Skip to contentSkip to conversation

regmap: Warn on raw I/O as well as bulk reads that bypass cache

PATCH In review Mark Brown 2 participants 2 messages Oct 9, 2011 – Oct 10, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regmap: Warn on raw I/O as well as bulk reads that bypass cache

As with the bulk reads we really should be able to make these play nicely with the cache but warn for now.

---
 drivers/base/regmap/regmap.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/base/regmap/regmap.c +4 -0
index d786ddc..85bffdd 100644
@@ -377,6 +377,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
 {
 	int ret;
 
+	WARN_ON(map->cache_type != REGCACHE_NONE);
+
 	mutex_lock(&map->lock);
 
 	ret = _regmap_raw_write(map, reg, val, val_len);
@@ -481,6 +483,8 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
 {
 	int ret;
 
+	WARN_ON(map->cache_type != REGCACHE_NONE);
+
 	mutex_lock(&map->lock);
 
 	ret = _regmap_raw_read(map, reg, val, val_len);
Signature · 1 line
1.7.6.3
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Mark Brown

As with the bulk reads we really should be able to make these play nicely with the cache but warn for now.

---
 drivers/base/regmap/regmap.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/base/regmap/regmap.c +4 -0
index d786ddc..85bffdd 100644
@@ -377,6 +377,8 @@ int regmap_raw_write(struct regmap *map, unsigned int reg,
 {
 	int ret;
 
+	WARN_ON(map->cache_type != REGCACHE_NONE);
+
 	mutex_lock(&map->lock);
 
 	ret = _regmap_raw_write(map, reg, val, val_len);
@@ -481,6 +483,8 @@ int regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
 {
 	int ret;
 
+	WARN_ON(map->cache_type != REGCACHE_NONE);
+
 	mutex_lock(&map->lock);
 
 	ret = _regmap_raw_read(map, reg, val, val_len);
Signature · 1 line
1.7.6.3

All of them look good.