Skip to content

Commit

Permalink
regulator: Update code examples in documentation
Browse files Browse the repository at this point in the history
This involves using the REGULATOR_SUPPLY initializer macro and
reindenting some of the code.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Jonathan Neuschäfer authored and Mark Brown committed Nov 29, 2017
1 parent 2befc01 commit 983ba99
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions Documentation/power/regulator/machine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ struct regulator_consumer_supply {
e.g. for the machine above

static struct regulator_consumer_supply regulator1_consumers[] = {
{
.dev_name = "dev_name(consumer B)",
.supply = "Vcc",
},};
REGULATOR_SUPPLY("Vcc", "consumer B"),
};

static struct regulator_consumer_supply regulator2_consumers[] = {
{
.dev = "dev_name(consumer A"),
.supply = "Vcc",
},};
REGULATOR_SUPPLY("Vcc", "consumer A"),
};

This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
to the 'Vcc' supply for Consumer A.
Expand Down Expand Up @@ -78,20 +74,20 @@ static struct regulator_init_data regulator2_data = {
Finally the regulator devices must be registered in the usual manner.

static struct platform_device regulator_devices[] = {
{
.name = "regulator",
.id = DCDC_1,
.dev = {
.platform_data = &regulator1_data,
{
.name = "regulator",
.id = DCDC_1,
.dev = {
.platform_data = &regulator1_data,
},
},
},
{
.name = "regulator",
.id = DCDC_2,
.dev = {
.platform_data = &regulator2_data,
{
.name = "regulator",
.id = DCDC_2,
.dev = {
.platform_data = &regulator2_data,
},
},
},
};
/* register regulator 1 device */
platform_device_register(&regulator_devices[0]);
Expand Down

0 comments on commit 983ba99

Please sign in to comment.