Commit 2ec0e92d authored by Matti Vaittinen's avatar Matti Vaittinen Committed by Greg Kroah-Hartman
Browse files

regulator: change stubbed devm_regulator_get_enable to return Ok



[ Upstream commit 96e20adc ]

The devm_regulator_get_enable() should be a 'call and forget' API,
meaning, when it is used to enable the regulators, the API does not
provide a handle to do any further control of the regulators. It gives
no real benefit to return an error from the stub if CONFIG_REGULATOR is
not set.

On the contrary, returning and error is causing problems to drivers when
hardware is such it works out just fine with no regulator control.
Returning an error forces drivers to specifically handle the case where
CONFIG_REGULATOR is not set, making the mere existence of the stub
questionalble. Furthermore, the stub of the regulator_enable() seems to
be returning Ok.

Change the stub implementation for the devm_regulator_get_enable() to
return Ok so drivers do not separately handle the case where the
CONFIG_REGULATOR is not set.

Signed-off-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Reported-by: default avatarAleksander Mazur <deweloper@wp.pl>
Suggested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Fixes: da279e69 ("regulator: Add devm helpers for get and enable")
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/ZiYF6d1V1vSPcsJS@drtxq0yyyyyyyyyyyyyby-3.rev.dnainternet.fi


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ed6877bc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment