Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: Remove support for optional supplies in the bulk API

The patch was based on my missinterpretation of the API and only
accidentally worked for me. Let's clean it out to not confuse others.

This reverts commit 3ff3f518a135fa4592fe2817e9ac2cce1fa23dc2.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Bjorn Andersson and committed by
Mark Brown
565f9b07 29b4817d

+4 -12
+2 -4
drivers/regulator/core.c
··· 3483 3483 consumers[i].consumer = NULL; 3484 3484 3485 3485 for (i = 0; i < num_consumers; i++) { 3486 - consumers[i].consumer = _regulator_get(dev, 3487 - consumers[i].supply, 3488 - false, 3489 - !consumers[i].optional); 3486 + consumers[i].consumer = regulator_get(dev, 3487 + consumers[i].supply); 3490 3488 if (IS_ERR(consumers[i].consumer)) { 3491 3489 ret = PTR_ERR(consumers[i].consumer); 3492 3490 dev_err(dev, "Failed to get supply '%s': %d\n",
+2 -5
drivers/regulator/devres.c
··· 164 164 consumers[i].consumer = NULL; 165 165 166 166 for (i = 0; i < num_consumers; i++) { 167 - consumers[i].consumer = _devm_regulator_get(dev, 168 - consumers[i].supply, 169 - consumers[i].optional ? 170 - OPTIONAL_GET : 171 - NORMAL_GET); 167 + consumers[i].consumer = devm_regulator_get(dev, 168 + consumers[i].supply); 172 169 if (IS_ERR(consumers[i].consumer)) { 173 170 ret = PTR_ERR(consumers[i].consumer); 174 171 dev_err(dev, "Failed to get supply '%s': %d\n",
-3
include/linux/regulator/consumer.h
··· 140 140 * 141 141 * @supply: The name of the supply. Initialised by the user before 142 142 * using the bulk regulator APIs. 143 - * @optional: The supply should be considered optional. Initialised by the user 144 - * before using the bulk regulator APIs. 145 143 * @consumer: The regulator consumer for the supply. This will be managed 146 144 * by the bulk API. 147 145 * ··· 149 151 */ 150 152 struct regulator_bulk_data { 151 153 const char *supply; 152 - bool optional; 153 154 struct regulator *consumer; 154 155 155 156 /* private: Internal use */