summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2014-02-20 08:50:10 +0800
committerMark Brown <broonie@linaro.org>2014-02-20 11:37:39 +0900
commite2f74dc6739731a6b6900946a21ac235181aa60f (patch)
treed731c177155c196dfd7ac4e5b3020b6c32ce85f3 /drivers/base
parentd4807ad2c4c0e17b6f00e3be9492c81de0804f40 (diff)
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: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index b897c1a88b56..9a426c081484 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1969,9 +1969,11 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,
if (tmp != orig) {
ret = _regmap_write(map, reg, tmp);
- *change = true;
+ if (change)
+ *change = true;
} else {
- *change = false;
+ if (change)
+ *change = false;
}
return ret;
@@ -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,
unsigned int mask, unsigned int val)
{
- bool change;
int ret;
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);
return ret;
@@ -2019,14 +2020,13 @@ EXPORT_SYMBOL_GPL(regmap_update_bits);
int regmap_update_bits_async(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val)
{
- bool change;
int ret;
map->lock(map->lock_arg);
map->async = true;
- ret = _regmap_update_bits(map, reg, mask, val, &change);
+ ret = _regmap_update_bits(map, reg, mask, val, NULL);
map->async = false;