Skip to content

Commit 983ba99

Browse files
neuschaeferbroonie
authored andcommitted
regulator: Update code examples in documentation
This involves using the REGULATOR_SUPPLY initializer macro and reindenting some of the code. Signed-off-by: Jonathan Neuschäfer <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 2befc01 commit 983ba99

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

Documentation/power/regulator/machine.txt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ struct regulator_consumer_supply {
2323
e.g. for the machine above
2424

2525
static struct regulator_consumer_supply regulator1_consumers[] = {
26-
{
27-
.dev_name = "dev_name(consumer B)",
28-
.supply = "Vcc",
29-
},};
26+
REGULATOR_SUPPLY("Vcc", "consumer B"),
27+
};
3028

3129
static struct regulator_consumer_supply regulator2_consumers[] = {
32-
{
33-
.dev = "dev_name(consumer A"),
34-
.supply = "Vcc",
35-
},};
30+
REGULATOR_SUPPLY("Vcc", "consumer A"),
31+
};
3632

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

8076
static struct platform_device regulator_devices[] = {
81-
{
82-
.name = "regulator",
83-
.id = DCDC_1,
84-
.dev = {
85-
.platform_data = &regulator1_data,
77+
{
78+
.name = "regulator",
79+
.id = DCDC_1,
80+
.dev = {
81+
.platform_data = &regulator1_data,
82+
},
8683
},
87-
},
88-
{
89-
.name = "regulator",
90-
.id = DCDC_2,
91-
.dev = {
92-
.platform_data = &regulator2_data,
84+
{
85+
.name = "regulator",
86+
.id = DCDC_2,
87+
.dev = {
88+
.platform_data = &regulator2_data,
89+
},
9390
},
94-
},
9591
};
9692
/* register regulator 1 device */
9793
platform_device_register(&regulator_devices[0]);

0 commit comments

Comments
 (0)