Merge remote-tracking branch 'regmap/fix/field' into regmap-linus

This commit is contained in:
Mark Brown 2015-06-17 17:40:07 +01:00
commit d2b923ef7b
1 changed files with 1 additions and 2 deletions

View File

@ -945,11 +945,10 @@ EXPORT_SYMBOL_GPL(devm_regmap_init);
static void regmap_field_init(struct regmap_field *rm_field, static void regmap_field_init(struct regmap_field *rm_field,
struct regmap *regmap, struct reg_field reg_field) struct regmap *regmap, struct reg_field reg_field)
{ {
int field_bits = reg_field.msb - reg_field.lsb + 1;
rm_field->regmap = regmap; rm_field->regmap = regmap;
rm_field->reg = reg_field.reg; rm_field->reg = reg_field.reg;
rm_field->shift = reg_field.lsb; rm_field->shift = reg_field.lsb;
rm_field->mask = ((BIT(field_bits) - 1) << reg_field.lsb); rm_field->mask = GENMASK(reg_field.msb, reg_field.lsb);
rm_field->id_size = reg_field.id_size; rm_field->id_size = reg_field.id_size;
rm_field->id_offset = reg_field.id_offset; rm_field->id_offset = reg_field.id_offset;
} }