* [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister
@ 2009-01-22 14:00 Mike Rapoport
2009-01-22 14:11 ` Mark Brown
2009-01-22 17:08 ` Liam Girdwood
0 siblings, 2 replies; 3+ messages in thread
From: Mike Rapoport @ 2009-01-22 14:00 UTC (permalink / raw)
To: Liam Girdwood; +Cc: LKML
Currently regulator_unregister does not clear regulator <--> consumer
mapping.
This patch introduces unset_regulator_supplies that clear the map.
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
drivers/regulator/core.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f511a40..ab1beec 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -817,6 +817,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, ®ulator_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,
@@ -1945,6 +1958,7 @@ void regulator_unregister(struct regulator_dev *rdev)
return;
mutex_lock(®ulator_list_mutex);
+ unset_regulator_supplies(rdev);
list_del(&rdev->list);
if (rdev->supply)
sysfs_remove_link(&rdev->dev.kobj, "supply");
--
1.5.6.4
--
Sincerely yours,
Mike.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister
2009-01-22 14:00 [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister Mike Rapoport
@ 2009-01-22 14:11 ` Mark Brown
2009-01-22 17:08 ` Liam Girdwood
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-01-22 14:11 UTC (permalink / raw)
To: Mike Rapoport; +Cc: Liam Girdwood, LKML
On Thu, Jan 22, 2009 at 04:00:29PM +0200, Mike Rapoport wrote:
> Currently regulator_unregister does not clear regulator <--> consumer
> mapping.
> This patch introduces unset_regulator_supplies that clear the map.
> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister
2009-01-22 14:00 [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister Mike Rapoport
2009-01-22 14:11 ` Mark Brown
@ 2009-01-22 17:08 ` Liam Girdwood
1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2009-01-22 17:08 UTC (permalink / raw)
To: Mike Rapoport; +Cc: LKML, Mark Brown
On Thu, 2009-01-22 at 16:00 +0200, Mike Rapoport wrote:
> Currently regulator_unregister does not clear regulator <--> consumer
> mapping.
> This patch introduces unset_regulator_supplies that clear the map.
>
> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
> ---
> drivers/regulator/core.c | 14 ++++++++++++++
> 1 files changed, 14 insertions(+), 0 deletions(-)
>
Applied.
Thanks
Liam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-22 17:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-22 14:00 [PATCH] regulator: add unset_regulator_supplies to fix regulator_unregister Mike Rapoport
2009-01-22 14:11 ` Mark Brown
2009-01-22 17:08 ` Liam Girdwood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.