diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-13 15:18:13 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-26 15:17:11 -0400 |
commit | f1b5c5c3423b59056d3ca956d2e795b7927d6008 (patch) | |
tree | 949fb255f17a2c7846ee224c7876b240198d8275 /drivers/base | |
parent | a42277c739c29b06cb27502347f557e11fed8b0e (diff) |
regmap: core: Warn on invalid operation combinations
Don't grind to a screaming halt, just generate a warning.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index aff5a8b73947..44a45cf0644b 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -950,7 +950,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
950 | size_t len; | 950 | size_t len; |
951 | int i; | 951 | int i; |
952 | 952 | ||
953 | BUG_ON(!map->bus); | 953 | WARN_ON(!map->bus); |
954 | 954 | ||
955 | /* Check for unwritable registers before we start */ | 955 | /* Check for unwritable registers before we start */ |
956 | if (map->writeable_reg) | 956 | if (map->writeable_reg) |
@@ -1104,7 +1104,7 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg, | |||
1104 | struct regmap_range_node *range; | 1104 | struct regmap_range_node *range; |
1105 | struct regmap *map = context; | 1105 | struct regmap *map = context; |
1106 | 1106 | ||
1107 | BUG_ON(!map->bus || !map->format.format_write); | 1107 | WARN_ON(!map->bus || !map->format.format_write); |
1108 | 1108 | ||
1109 | range = _regmap_range_lookup(map, reg); | 1109 | range = _regmap_range_lookup(map, reg); |
1110 | if (range) { | 1110 | if (range) { |
@@ -1130,7 +1130,7 @@ static int _regmap_bus_raw_write(void *context, unsigned int reg, | |||
1130 | { | 1130 | { |
1131 | struct regmap *map = context; | 1131 | struct regmap *map = context; |
1132 | 1132 | ||
1133 | BUG_ON(!map->bus || !map->format.format_val); | 1133 | WARN_ON(!map->bus || !map->format.format_val); |
1134 | 1134 | ||
1135 | map->format.format_val(map->work_buf + map->format.reg_bytes | 1135 | map->format.format_val(map->work_buf + map->format.reg_bytes |
1136 | + map->format.pad_bytes, val, 0); | 1136 | + map->format.pad_bytes, val, 0); |
@@ -1356,7 +1356,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val, | |||
1356 | u8 *u8 = map->work_buf; | 1356 | u8 *u8 = map->work_buf; |
1357 | int ret; | 1357 | int ret; |
1358 | 1358 | ||
1359 | BUG_ON(!map->bus); | 1359 | WARN_ON(!map->bus); |
1360 | 1360 | ||
1361 | range = _regmap_range_lookup(map, reg); | 1361 | range = _regmap_range_lookup(map, reg); |
1362 | if (range) { | 1362 | if (range) { |
@@ -1411,7 +1411,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg, | |||
1411 | int ret; | 1411 | int ret; |
1412 | void *context = _regmap_map_get_context(map); | 1412 | void *context = _regmap_map_get_context(map); |
1413 | 1413 | ||
1414 | BUG_ON(!map->reg_read); | 1414 | WARN_ON(!map->reg_read); |
1415 | 1415 | ||
1416 | if (!map->cache_bypass) { | 1416 | if (!map->cache_bypass) { |
1417 | ret = regcache_read(map, reg, val); | 1417 | ret = regcache_read(map, reg, val); |