linux-stable/include/linux/regulator
Douglas Anderson fb2b60e27a regulator: Don't return or expect -errno from of_map_mode()
[ Upstream commit 02f3703934 ]

In of_get_regulation_constraints() we were taking the result of
of_map_mode() (an unsigned int) and assigning it to an int.  We were
then checking whether this value was -EINVAL.  Some implementers of
of_map_mode() were returning -EINVAL (even though the return type of
their function needed to be unsigned int) because they needed to
signal an error back to of_get_regulation_constraints().

In general in the regulator framework the mode is always referred to
as an unsigned int.  While we could fix this to be a signed int (the
highest value we store in there right now is 0x8), it's actually
pretty clean to just define the regulator mode 0x0 (the lack of any
bits set) as an invalid mode.  Let's do that.

Fixes: 5e5e3a42c6 ("regulator: of: Add support for parsing initial and suspend modes")
Suggested-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-03 07:50:40 +02:00
..
ab8500.h
act8865.h
arizona-ldo1.h
arizona-micsupp.h
consumer.h regulator: Don't return or expect -errno from of_map_mode() 2018-08-03 07:50:40 +02:00
da9211.h
db8500-prcmu.h
driver.h
fan53555.h
fixed.h
gpio-regulator.h
lp872x.h
lp3971.h
lp3972.h
machine.h
max1586.h
max8649.h
max8660.h
max8952.h
max8973-regulator.h
mt6311.h
mt6323-regulator.h
mt6380-regulator.h
mt6397-regulator.h
of_regulator.h
pfuze100.h
tps6507x.h
tps51632-regulator.h
tps62360.h
userspace-consumer.h