linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regmap: Properly round reg_bytes and val_bytes
@ 2012-01-28  1:16 Wolfram Sang
  2012-01-29 21:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2012-01-28  1:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Wolfram Sang

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: Wolfram Sang <w.sang@pengutronix.de>
---

rebased to topic/core

 drivers/base/regmap/regmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index b4475d8..3c34526 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -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;
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: Properly round reg_bytes and val_bytes
  2012-01-28  1:16 [PATCH] regmap: Properly round reg_bytes and val_bytes Wolfram Sang
@ 2012-01-29 21:43 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-01-29 21:43 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

On Sat, Jan 28, 2012 at 02:16:41AM +0100, Wolfram Sang wrote:
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-29 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-28  1:16 [PATCH] regmap: Properly round reg_bytes and val_bytes Wolfram Sang
2012-01-29 21:43 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).