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

Commit c212accc authored by Wolfram Sang's avatar Wolfram Sang Committed by Mark Brown
Browse files

regmap: Properly round reg_bytes and val_bytes



For the upcoming 2/6-format, we don't see debugfs output otherwise,
since the current division results in 0. I'd think 10/14 is broken
currently, too.

Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 9aa50750
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -167,9 +167,9 @@ struct regmap *regmap_init(struct device *dev,

	mutex_init(&map->lock);
	map->format.buf_size = (config->reg_bits + config->val_bits) / 8;
	map->format.reg_bytes = config->reg_bits / 8;
	map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8);
	map->format.pad_bytes = config->pad_bits / 8;
	map->format.val_bytes = config->val_bits / 8;
	map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
	map->format.buf_size += map->format.pad_bytes;
	map->dev = dev;
	map->bus = bus;