From: Wolfram Sang <w.sang@pengutronix.de>
To: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>, Lars-Peter Clausen <lars@metafoo.de>,
Wolfram Sang <w.sang@pengutronix.de>
Subject: [PATCH 1/3] regmap: Properly round reg_bytes and val_bytes
Date: Fri, 27 Jan 2012 16:10:21 +0100 [thread overview]
Message-ID: <1327677023-29310-1-git-send-email-w.sang@pengutronix.de> (raw)
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>
---
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 6555803..8bd0232 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -159,8 +159,8 @@ 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.val_bytes = config->val_bits / 8;
+ map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8);
+ map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
map->dev = dev;
map->bus = bus;
map->max_register = config->max_register;
--
1.7.8.3
next reply other threads:[~2012-01-27 15:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 15:10 Wolfram Sang [this message]
2012-01-27 15:10 ` [PATCH 2/3] regmap: Add support for 2/6 register formating Wolfram Sang
2012-01-27 16:28 ` Mark Brown
2012-01-27 15:10 ` [PATCH 3/3] ASoC: codecs: add driver for max9768 amplifier Wolfram Sang
2012-01-27 16:25 ` Mark Brown
2012-01-30 21:54 ` [alsa-devel] " Mark Brown
2012-01-27 16:28 ` [PATCH 1/3] regmap: Properly round reg_bytes and val_bytes Mark Brown
2012-01-28 1:14 ` Wolfram Sang
2012-01-30 13:21 ` Mark Brown
2012-01-30 13:35 ` Wolfram Sang
2012-01-30 13:45 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327677023-29310-1-git-send-email-w.sang@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).