regmap: prevent division by zero in rbtree_show
authorStephen Warren <swarren@nvidia.com>
Wed, 4 Apr 2012 21:48:33 +0000 (15:48 -0600)
committerSimone Willett <swillett@nvidia.com>
Sun, 15 Apr 2012 21:12:08 +0000 (14:12 -0700)
commit88deb440c6cea0709f3118d9727d925b632612a3
treec49139933b68d8a438ba3641ca0d036aca14c01e
parente42eab476ec6a043814608b1375c1632c86fba74
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
(cherry picked from commit c04c1b9ee8f30c7a3a25e20e406247003f634ebe)

Change-Id: I30047f1e0bd08417794c3d19e2fe1d480a74e083
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/96501
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
drivers/base/regmap/regcache-rbtree.c