Skip to content

Commit 492c826

Browse files
broonieLiam Girdwood
authored andcommitted
regulator: Remove supply_regulator_dev from machine configuration
supply_regulator_dev (using a struct pointer) has been deprecated in favour of supply_regulator (using a regulator name) for quite a few releases now with a warning generated if it is used and there are no current in tree users so just remove the code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
1 parent ba413c5 commit 492c826

3 files changed

Lines changed: 2 additions & 21 deletions

File tree

‎Documentation/power/regulator/machine.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ static struct regulator_init_data regulator1_data = {
5353

5454
Regulator-1 supplies power to Regulator-2. This relationship must be registered
5555
with the core so that Regulator-1 is also enabled when Consumer A enables its
56-
supply (Regulator-2). The supply regulator is set by the supply_regulator_dev
56+
supply (Regulator-2). The supply regulator is set by the supply_regulator
5757
field below:-
5858

5959
static struct regulator_init_data regulator2_data = {
60-
.supply_regulator_dev = &platform_regulator1_device.dev,
60+
.supply_regulator = "regulator_name",
6161
.constraints = {
6262
.min_uV = 1800000,
6363
.max_uV = 2000000,

‎drivers/regulator/core.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,14 +2596,6 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
25962596
if (ret < 0)
25972597
goto scrub;
25982598

2599-
/* set supply regulator if it exists */
2600-
if (init_data->supply_regulator && init_data->supply_regulator_dev) {
2601-
dev_err(dev,
2602-
"Supply regulator specified by both name and dev\n");
2603-
ret = -EINVAL;
2604-
goto scrub;
2605-
}
2606-
26072599
if (init_data->supply_regulator) {
26082600
struct regulator_dev *r;
26092601
int found = 0;
@@ -2628,14 +2620,6 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
26282620
goto scrub;
26292621
}
26302622

2631-
if (init_data->supply_regulator_dev) {
2632-
dev_warn(dev, "Uses supply_regulator_dev instead of regulator_supply\n");
2633-
ret = set_supply(rdev,
2634-
dev_get_drvdata(init_data->supply_regulator_dev));
2635-
if (ret < 0)
2636-
goto scrub;
2637-
}
2638-
26392623
/* add consumers devices */
26402624
for (i = 0; i < init_data->num_consumer_supplies; i++) {
26412625
ret = set_consumer_device_supply(rdev,

‎include/linux/regulator/machine.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ struct regulator_consumer_supply {
160160
* @supply_regulator: Parent regulator. Specified using the regulator name
161161
* as it appears in the name field in sysfs, which can
162162
* be explicitly set using the constraints field 'name'.
163-
* @supply_regulator_dev: Parent regulator (if any) - DEPRECATED in favour
164-
* of supply_regulator.
165163
*
166164
* @constraints: Constraints. These must be specified for the regulator to
167165
* be usable.
@@ -173,7 +171,6 @@ struct regulator_consumer_supply {
173171
*/
174172
struct regulator_init_data {
175173
const char *supply_regulator; /* or NULL for system supply */
176-
struct device *supply_regulator_dev; /* or NULL for system supply */
177174

178175
struct regulation_constraints constraints;
179176

0 commit comments

Comments
 (0)