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

regmap: cache: cleanup regcache_hw_init()



Remove the redundant code for regmap cache.

Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f114040e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -57,12 +57,9 @@ static int regcache_hw_init(struct regmap *map)
	}

	/* calculate the size of reg_defaults */
	for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++) {
		val = regcache_get_val(map, map->reg_defaults_raw, i);
		if (regmap_volatile(map, i * map->reg_stride))
			continue;
	for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++)
		if (!regmap_volatile(map, i * map->reg_stride))
			count++;
	}

	map->reg_defaults = kmalloc(count * sizeof(struct reg_default),
				      GFP_KERNEL);