regmap: use rb_entry()

To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Geliang Tang
2016-12-19 22:40:25 +08:00
committed by Mark Brown
parent daaadbf074
commit 671a911bb9
2 changed files with 5 additions and 6 deletions

View File

@@ -459,7 +459,7 @@ static bool _regmap_range_add(struct regmap *map,
while (*new) {
struct regmap_range_node *this =
container_of(*new, struct regmap_range_node, node);
rb_entry(*new, struct regmap_range_node, node);
parent = *new;
if (data->range_max < this->range_min)
@@ -483,7 +483,7 @@ static struct regmap_range_node *_regmap_range_lookup(struct regmap *map,
while (node) {
struct regmap_range_node *this =
container_of(node, struct regmap_range_node, node);
rb_entry(node, struct regmap_range_node, node);
if (reg < this->range_min)
node = node->rb_left;