提交 0ff3e62f 编写于 作者: M Mark Brown

regmap: Make return code checks consistent

The range code was written to check for return codes less than zero as
errors but throughout the rest of the API return codes not equal to zero
are errors. Change all these checks to match the house style.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 98bc7dfd
...@@ -606,7 +606,7 @@ struct regmap *regmap_init(struct device *dev, ...@@ -606,7 +606,7 @@ struct regmap *regmap_init(struct device *dev,
} }
ret = regcache_init(map, config); ret = regcache_init(map, config);
if (ret < 0) if (ret != 0)
goto err_range; goto err_range;
regmap_debugfs_init(map, config->name); regmap_debugfs_init(map, config->name);
...@@ -803,7 +803,7 @@ static int _regmap_select_page(struct regmap *map, unsigned int *reg, ...@@ -803,7 +803,7 @@ static int _regmap_select_page(struct regmap *map, unsigned int *reg,
map->work_buf = orig_work_buf; map->work_buf = orig_work_buf;
if (ret < 0) if (ret != 0)
return ret; return ret;
} }
...@@ -854,7 +854,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, ...@@ -854,7 +854,7 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
if (range) { if (range) {
ret = _regmap_select_page(map, &reg, range, ret = _regmap_select_page(map, &reg, range,
val_len / map->format.val_bytes); val_len / map->format.val_bytes);
if (ret < 0) if (ret != 0)
return ret; return ret;
} }
...@@ -930,7 +930,7 @@ int _regmap_write(struct regmap *map, unsigned int reg, ...@@ -930,7 +930,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
range = _regmap_range_lookup(map, reg); range = _regmap_range_lookup(map, reg);
if (range) { if (range) {
ret = _regmap_select_page(map, &reg, range, 1); ret = _regmap_select_page(map, &reg, range, 1);
if (ret < 0) if (ret != 0)
return ret; return ret;
} }
...@@ -1096,7 +1096,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val, ...@@ -1096,7 +1096,7 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
if (range) { if (range) {
ret = _regmap_select_page(map, &reg, range, ret = _regmap_select_page(map, &reg, range,
val_len / map->format.val_bytes); val_len / map->format.val_bytes);
if (ret < 0) if (ret != 0)
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册