Commit f5a6d351 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Mark Brown

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: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1a695a90
...@@ -79,18 +79,8 @@ of_get_fixed_voltage_config(struct device *dev, ...@@ -79,18 +79,8 @@ of_get_fixed_voltage_config(struct device *dev,
config->enabled_at_boot = true; config->enabled_at_boot = true;
config->gpio = of_get_named_gpio(np, "gpio", 0); config->gpio = of_get_named_gpio(np, "gpio", 0);
/* if ((config->gpio < 0) && (config->gpio != -ENOENT))
* of_get_named_gpio() currently returns ENODEV rather than return ERR_PTR(config->gpio);
* EPROBE_DEFER. This code attempts to be compatible with both
* for now; the ENODEV check can be removed once the API is fixed.
* of_get_named_gpio() doesn't differentiate between a missing
* property (which would be fine here, since the GPIO is optional)
* and some other error. Patches have been posted for both issues.
* Once they are check in, we should replace this with:
* if (config->gpio < 0 && config->gpio != -ENOENT)
*/
if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
return ERR_PTR(-EPROBE_DEFER);
of_property_read_u32(np, "startup-delay-us", &config->startup_delay); of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment