提交 e2f74dc6 编写于 作者: X Xiubo Li 提交者: Mark Brown

regmap: Clean up _regmap_update_bits()

Since sometimes the 'config' parameter has no use, it should be NULL.
And make the code simplifier.
Signed-off-by: NXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 d4807ad2
...@@ -1969,8 +1969,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg, ...@@ -1969,8 +1969,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
if (tmp != orig) { if (tmp != orig) {
ret = _regmap_write(map, reg, tmp); ret = _regmap_write(map, reg, tmp);
if (change)
*change = true; *change = true;
} else { } else {
if (change)
*change = false; *change = false;
} }
...@@ -1990,11 +1992,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg, ...@@ -1990,11 +1992,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
int regmap_update_bits(struct regmap *map, unsigned int reg, int regmap_update_bits(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val) unsigned int mask, unsigned int val)
{ {
bool change;
int ret; int ret;
map->lock(map->lock_arg); map->lock(map->lock_arg);
ret = _regmap_update_bits(map, reg, mask, val, &change); ret = _regmap_update_bits(map, reg, mask, val, NULL);
map->unlock(map->lock_arg); map->unlock(map->lock_arg);
return ret; return ret;
...@@ -2019,14 +2020,13 @@ EXPORT_SYMBOL_GPL(regmap_update_bits); ...@@ -2019,14 +2020,13 @@ EXPORT_SYMBOL_GPL(regmap_update_bits);
int regmap_update_bits_async(struct regmap *map, unsigned int reg, int regmap_update_bits_async(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val) unsigned int mask, unsigned int val)
{ {
bool change;
int ret; int ret;
map->lock(map->lock_arg); map->lock(map->lock_arg);
map->async = true; map->async = true;
ret = _regmap_update_bits(map, reg, mask, val, &change); ret = _regmap_update_bits(map, reg, mask, val, NULL);
map->async = false; map->async = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册