regmap: prevent division by zero in rbtree_show
authorStephen Warren <swarren@nvidia.com>
Wed, 4 Apr 2012 21:48:33 +0000 (15:48 -0600)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 4 Apr 2012 22:22:15 +0000 (23:22 +0100)
commitc04c1b9ee8f30c7a3a25e20e406247003f634ebe
treec8f1de34051bce402ee5be5d6dfadc4bc7e47ae1
parente466de05194b666114713b753e2f4be1d4200140
regmap: prevent division by zero in rbtree_show

If there are no nodes in the cache, nodes will be 0, so calculating
"registers / nodes" will cause division by zero.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
drivers/base/regmap/regcache-rbtree.c