diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2017-11-19 08:09:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-29 13:41:16 +0300 |
commit | 983ba99a8f275aae9614a30469d0f480550fbc24 (patch) | |
tree | 9a080369eeefe80337e8a1f7b14e0f25ff629a96 /Documentation/power | |
parent | 2befc01bf7358ab635ca362f3f5ba37d99ef31c4 (diff) | |
download | linux-983ba99a8f275aae9614a30469d0f480550fbc24.tar.xz |
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 <j.neuschaefer@gmx.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'Documentation/power')
-rw-r--r-- | Documentation/power/regulator/machine.txt | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Documentation/power/regulator/machine.txt b/Documentation/power/regulator/machine.txt index 757e3b53dc11..eff4dcaaa252 100644 --- a/Documentation/power/regulator/machine.txt +++ b/Documentation/power/regulator/machine.txt @@ -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. @@ -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 = ®ulator1_data, + { + .name = "regulator", + .id = DCDC_1, + .dev = { + .platform_data = ®ulator1_data, + }, }, -}, -{ - .name = "regulator", - .id = DCDC_2, - .dev = { - .platform_data = ®ulator2_data, + { + .name = "regulator", + .id = DCDC_2, + .dev = { + .platform_data = ®ulator2_data, + }, }, -}, }; /* register regulator 1 device */ platform_device_register(®ulator_devices[0]); |