Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198382
b: refs/heads/master
c: d4033b5
h: refs/heads/master
v: v3
  • Loading branch information
Jani Nikula authored and Liam Girdwood committed May 25, 2010
1 parent a6ed0b5 commit 80c7aaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47bd53f0e8008294ff58c5b37d713f25a8dc56aa
refs/heads/master: d4033b54fc91221b13e2850bf298683c0f2ff37d
35 changes: 5 additions & 30 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,29 +981,6 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
return 0;
}

static void unset_consumer_device_supply(struct regulator_dev *rdev,
const char *consumer_dev_name, struct device *consumer_dev)
{
struct regulator_map *node, *n;

if (consumer_dev && !consumer_dev_name)
consumer_dev_name = dev_name(consumer_dev);

list_for_each_entry_safe(node, n, &regulator_map_list, list) {
if (rdev != node->regulator)
continue;

if (consumer_dev_name && node->dev_name &&
strcmp(consumer_dev_name, node->dev_name))
continue;

list_del(&node->list);
kfree(node->dev_name);
kfree(node);
return;
}
}

static void unset_regulator_supplies(struct regulator_dev *rdev)
{
struct regulator_map *node, *n;
Expand Down Expand Up @@ -2375,20 +2352,18 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
init_data->consumer_supplies[i].dev,
init_data->consumer_supplies[i].dev_name,
init_data->consumer_supplies[i].supply);
if (ret < 0) {
for (--i; i >= 0; i--)
unset_consumer_device_supply(rdev,
init_data->consumer_supplies[i].dev_name,
init_data->consumer_supplies[i].dev);
goto scrub;
}
if (ret < 0)
goto unset_supplies;
}

list_add(&rdev->list, &regulator_list);
out:
mutex_unlock(&regulator_list_mutex);
return rdev;

unset_supplies:
unset_regulator_supplies(rdev);

scrub:
device_unregister(&rdev->dev);
/* device core frees rdev */
Expand Down

0 comments on commit 80c7aaf

Please sign in to comment.