Commit f4e52e7f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'regmap-3.4-fixes' of git://

Pull two more small regmap fixes from Mark Brown:
 - Now we have users for it that aren't running Android it turns out
   that regcache_sync_region() is much more useful to drivers if it's
   exported for use by modules.  Who knew?
 - Make sure we don't divide by zero when doing debugfs dumps of
   rbtrees, not visible up until now because everything was providing at
   least some cache on startup.

* tag 'regmap-3.4-fixes' of git://
  regmap: prevent division by zero in rbtree_show
  regmap: Export regcache_sync_region()
parents a3fac080 c04c1b9e
......@@ -138,6 +138,7 @@ static int rbtree_show(struct seq_file *s, void *ignored)
unsigned int base, top;
int nodes = 0;
int registers = 0;
int average;
......@@ -152,8 +153,13 @@ static int rbtree_show(struct seq_file *s, void *ignored)
registers += top - base + 1;
if (nodes)
average = registers / nodes;
average = 0;
seq_printf(s, "%d nodes, %d registers, average %d registers\n",
nodes, registers, registers / nodes);
nodes, registers, average);
......@@ -346,6 +346,7 @@ out:
return ret;
* regcache_cache_only: Put a register map into cache only mode
Supports Markdown
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