summaryrefslogtreecommitdiffstats
path: root/samples/livepatch
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-12-06 13:43:37 +0100
committerMark Brown <broonie@kernel.org>2018-12-11 01:02:57 +0000
commit0edb040d416ab350c02ac710233349aeaf8c2a26 (patch)
treee0ebbe188ee790a84c21aeb21558a14818087d4f /samples/livepatch
parentc32569e358adea225f053ef9d97a4c8c18be8743 (diff)
downloadblackbird-obmc-linux-0edb040d416ab350c02ac710233349aeaf8c2a26.tar.gz
blackbird-obmc-linux-0edb040d416ab350c02ac710233349aeaf8c2a26.zip
regulator: core: Track dangling GPIO descriptors
If a GPIO descriptor is passed to the regulator_register() function inside the config->ena_gpiod callers must be sure that once they call this API the regulator core owns that descriptor and will make sure to issue gpiod_put() on it, no matter whether the call is successful or not. For device tree regulators, the regulator core will automatically set up regulator init data from the device tree when registering a regulator by calling regulator_of_get_init_data() which in turn calls down to the regulator driver's .of_parse_cb() callback. This callback (in drivers such as for max77686) may also choose to fill in the config->ena_gpiod field with a GPIO descriptor. Harden the errorpath of regulator_register() to properly gpiod_put() any passed in cfg->ena_gpiod or any gpiod coming from the device tree on any type of error. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'samples/livepatch')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud