Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280550
b: refs/heads/master
c: d91e8db
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Nov 20, 2011
1 parent 6a3ac36 commit 728697b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c691664583ef6a91f9ed0e08a75fbd30a5ffd5c
refs/heads/master: d91e8db2c3bbe8ef0e2f3e1a6ff5b31a8d53ef16
9 changes: 5 additions & 4 deletions trunk/drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,18 +583,19 @@ int regmap_update_bits(struct regmap *map, unsigned int reg,
unsigned int mask, unsigned int val)
{
int ret;
unsigned int tmp;
unsigned int tmp, orig;

mutex_lock(&map->lock);

ret = _regmap_read(map, reg, &tmp);
ret = _regmap_read(map, reg, &orig);
if (ret != 0)
goto out;

tmp &= ~mask;
tmp = orig & ~mask;
tmp |= val & mask;

ret = _regmap_write(map, reg, tmp);
if (tmp != orig)
ret = _regmap_write(map, reg, tmp);

out:
mutex_unlock(&map->lock);
Expand Down

0 comments on commit 728697b

Please sign in to comment.