Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140248
b: refs/heads/master
c: 0f1d747
h: refs/heads/master
v: v3
  • Loading branch information
Mike Rapoport authored and Liam Girdwood committed Mar 31, 2009
1 parent 67ca75d commit 265bb5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90ca563b1030bece8a4f15a910e39a46f059ff48
refs/heads/master: 0f1d747bfa89de4ca52dc1dffdcce35a2b8a1532
14 changes: 14 additions & 0 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,19 @@ static void unset_consumer_device_supply(struct regulator_dev *rdev,
}
}

static void unset_regulator_supplies(struct regulator_dev *rdev)
{
struct regulator_map *node, *n;

list_for_each_entry_safe(node, n, &regulator_map_list, list) {
if (rdev == node->regulator) {
list_del(&node->list);
kfree(node);
return;
}
}
}

#define REG_STR_SIZE 32

static struct regulator *create_regulator(struct regulator_dev *rdev,
Expand Down Expand Up @@ -1970,6 +1983,7 @@ void regulator_unregister(struct regulator_dev *rdev)
return;

mutex_lock(&regulator_list_mutex);
unset_regulator_supplies(rdev);
list_del(&rdev->list);
if (rdev->supply)
sysfs_remove_link(&rdev->dev.kobj, "supply");
Expand Down

0 comments on commit 265bb5f

Please sign in to comment.