Commit d2b923ef authored by Mark Brown's avatar Mark Brown

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

parents 59345907 921cc294
...@@ -945,11 +945,10 @@ EXPORT_SYMBOL_GPL(devm_regmap_init); ...@@ -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;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment