regulator: core: Correct default return value for full constraints
authorMark Brown <broonie@linaro.org>
Mon, 27 Jan 2014 17:34:07 +0000 (17:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 19:10:07 +0000 (11:10 -0800)
commit78298bb3029d1c868f41541764716a80f427a153
tree6134c1e82083983b6b87b117bcd16cd836213480
parent8b44deea7961078f654da44f89583138f85c978c
regulator: core: Correct default return value for full constraints

commit 317b5684d52269b75b4ec6480f9dac056d0d4ba8 upstream.

Once we have full constraints then all supply mappings should be known to
the regulator API. This means that we should treat failed lookups as fatal
rather than deferring in the hope of further registrations but this was
broken by commit 9b92da1f1205bd25 "regulator: core: Fix default return
value for _get()" which was targeted at DT systems but unintentionally
broke non-DT systems by changing the default return value.

Fix this by explicitly returning -EPROBE_DEFER from the DT lookup if we
find a property but no corresponding regulator and by having the non-DT
case default to -ENODEV when we have full constraints.

Fixes: 9b92da1f1205bd25 "regulator: core: Fix default return value for _get()"
Signed-off-by: Mark Brown <broonie@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/core.c