Re: mc13xxx-core: kernel hangs after 'regmap_read'
From: Mark Brown
Date: Thu May 24 2012 - 06:37:52 EST
On Thu, May 24, 2012 at 07:08:37PM +1000, Marc Reilly wrote:
> I'm wondering about regmap_init where the buf_size is set up. I think it will
> only end up being 3 bytes. I think line 249 should be something like:
> map->format.buf_size = (config->reg_bits
> + config->val_bits
> + (config->pad_bits % 8)) / 8;
> or perhaps better:
> map->reg_shift = config->pad_bits % 8;
> map->format.buf_size = (config->reg_bits
> + config->val_bits
> + map->reg_shift) / 8;
Yes, that's been missed in the addition of padding. We should also be
using DIV_ROUND_UP() which we aren't at the minute. We could also do
reg_bytes + pad_bytes + val_bytes which should cover everything I think?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/