regmap: core: Warn on invalid operation combinations
Subsystems (2)
PATCH 1/2 regmap: core: Warn on invalid operation combinations
Don't grind to a screaming halt, just generate a warning.
Signed-off-by Mark Brown <[email protected]>
--- drivers/base/regmap/regmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/base/regmap/regmap.c +5 -5
@@ -950,7 +950,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,size_t len;int i; -BUG_ON (!map->bus); +WARN_ON (!map->bus);/* Check for unwritable registers before we start */ if (map->writeable_reg)
@@ -1106,7 +1106,7 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg,struct regmap_range_node *range;struct regmap *map = context; -BUG_ON (!map->bus || !map->format.format_write); +WARN_ON (!map->bus || !map->format.format_write); range =_regmap_range_lookup (map, reg);if (range) {
@@ -1132,7 +1132,7 @@ static int _regmap_bus_raw_write(void *context, unsigned int reg, {struct regmap *map = context; -BUG_ON (!map->bus || !map->format.format_val); +WARN_ON (!map->bus || !map->format.format_val); map->format.format_val (map->work_buf + map->format.reg_bytes + map->format.pad_bytes, val,0 );
@@ -1358,7 +1358,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,u8 *u8 = map->work_buf;int ret; -BUG_ON (!map->bus); +WARN_ON (!map->bus); range =_regmap_range_lookup (map, reg);if (range) {
@@ -1413,7 +1413,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,int ret;void *context =_regmap_map_get_context (map); -BUG_ON (!map->reg_read); +WARN_ON (!map->reg_read);if (!map->cache_bypass) { ret =regcache_read (map, reg, val);
Signature · 1 line
1.7.10.4
PATCH 2/2 regmap: core: Make raw write available to regcache
This allows the cache to sync values directly to the device when stored in native format and also allows asynchronous I/O.
Signed-off-by Mark Brown <[email protected]>
--- drivers/base/regmap/internal.h | 3 +++ drivers/base/regmap/regmap.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/base/regmap/internal.h +3 -0
@@ -196,6 +196,9 @@ bool regcache_set_val(struct regmap *map, void *base, unsigned int idx, unsigned int val);int regcache_lookup_reg (struct regmap *map,unsigned int reg); +int _regmap_raw_write (struct regmap *map,unsigned int reg, +const void *val,size_t val_len,bool async); +void regmap_async_complete_cb (struct regmap_async *async,int ret);extern struct regcache_ops regcache_rbtree_ops;
drivers/base/regmap/regmap.c +2 -2
@@ -937,8 +937,8 @@ static int _regmap_select_page(struct regmap *map, unsigned int *reg,return 0 ; } -static int _regmap_raw_write (struct regmap *map,unsigned int reg, -const void *val,size_t val_len,bool async) +int _regmap_raw_write (struct regmap *map,unsigned int reg, +const void *val,size_t val_len,bool async) {struct regmap_range_node *range;unsigned long flags;
Signature · 1 line
1.7.10.4