linux-xiaomi-chiron/include/linux/regulator
Douglas Anderson 02f3703934
regulator: Don't return or expect -errno from of_map_mode()
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>
2018-04-20 12:45:36 +01:00
..
ab8500.h regulator: ab8500: Drop AB8540/9540 support 2018-04-16 13:08:59 +01:00
act8865.h regulator: act8865: Pass of_node via act8865_regulator_data 2016-03-28 12:34:20 -07:00
arizona-ldo1.h regulator: arizona-ldo1: Move pdata into a separate structure 2017-04-25 16:36:32 +01:00
arizona-micsupp.h regulator: arizona-micsupp: Move pdata into a separate structure 2017-04-25 16:36:20 +01:00
consumer.h regulator: Don't return or expect -errno from of_map_mode() 2018-04-20 12:45:36 +01:00
da9211.h regulator: da9211: Pass descriptors instead of GPIO numbers 2018-02-16 17:05:52 +00:00
db8500-prcmu.h
driver.h regulator: core: Support passing an initialized GPIO enable descriptor 2018-02-16 17:04:02 +00:00
fan53555.h
fixed.h
gpio-regulator.h
lp872x.h regulator: lp872x: Add enable GPIO pin support 2016-02-05 18:57:09 +00:00
lp3971.h
lp3972.h
machine.h regulator: add PM suspend and resume hooks 2018-01-26 14:43:55 +00:00
max1586.h
max8649.h
max8660.h
max8952.h
max8973-regulator.h regulator: max8973: add support for junction thermal warning 2016-04-13 17:19:26 +01:00
mt6311.h regulator: mt6311: Add support for mt6311 regulator 2015-07-24 12:30:49 +01:00
mt6323-regulator.h regulator: mt6323: Add support for MT6323 regulator 2016-07-18 13:46:23 +01:00
mt6380-regulator.h regulator: mt6380: Add support for MT6380 2017-08-15 12:50:48 +01:00
mt6397-regulator.h regulator: mt6397: Add support for MT6397 regulator 2014-12-24 12:41:05 +00:00
of_regulator.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pfuze100.h regulator: pfuze100-regulator: add coin support 2017-03-13 16:15:42 +00:00
tps6507x.h
tps51632-regulator.h
tps62360.h
userspace-consumer.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00