aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2016-03-13 09:16:57 -0400
committerMark Brown <broonie@kernel.org>2016-05-30 11:29:34 -0400
commitf5a6d3516362f85d6a07e930bc10cd4b59f306c7 (patch)
tree7c9d79b686aedd9a8e1836bfd9e81cc2efcf7a8f
parent1a695a905c18548062509178b98bc91e67510864 (diff)
regulator: fixed: Remove workaround to handle of_get_named_gpio() return
The GPIO interface of_get_named_gpio() has implemented the proper error returns even EPROBE_DEFER and hence caller need not to implement any workaround for translating the returned error. Remove the workaround implemented to handle the return of of_get_named_gpio(). Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/fixed.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index ff62d69ba0be..988a7472c2ab 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -79,18 +79,8 @@ of_get_fixed_voltage_config(struct device *dev,
79 config->enabled_at_boot = true; 79 config->enabled_at_boot = true;
80 80
81 config->gpio = of_get_named_gpio(np, "gpio", 0); 81 config->gpio = of_get_named_gpio(np, "gpio", 0);
82 /* 82 if ((config->gpio < 0) && (config->gpio != -ENOENT))
83 * of_get_named_gpio() currently returns ENODEV rather than 83 return ERR_PTR(config->gpio);
84 * EPROBE_DEFER. This code attempts to be compatible with both
85 * for now; the ENODEV check can be removed once the API is fixed.
86 * of_get_named_gpio() doesn't differentiate between a missing
87 * property (which would be fine here, since the GPIO is optional)
88 * and some other error. Patches have been posted for both issues.
89 * Once they are check in, we should replace this with:
90 * if (config->gpio < 0 && config->gpio != -ENOENT)
91 */
92 if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
93 return ERR_PTR(-EPROBE_DEFER);
94 84
95 of_property_read_u32(np, "startup-delay-us", &config->startup_delay); 85 of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
96 86