Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2f74dc6 authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown
Browse files

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: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent d4807ad2
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1969,8 +1969,10 @@ static int _regmap_update_bits(struct regmap *map, unsigned int reg,

	if (tmp != orig) {
		ret = _regmap_write(map, reg, tmp);
		if (change)
			*change = true;
	} else {
		if (change)
			*change = false;
	}

@@ -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;