]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: Add devm_gpiod_unhinge()
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 6 Dec 2018 12:43:46 +0000 (13:43 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 11 Dec 2018 01:04:23 +0000 (01:04 +0000)
commitd68baa65152d485f4362103626bb09004f6c8c1e
treee4b1a683a2b5761d77b4525368f251897644b0a6
parent8b068e5196fbff8ad88602398deec5cfb68a12f0
gpio: Add devm_gpiod_unhinge()

This adds a function named devm_gpiod_unhinge() that removes
the resource management from a GPIO descriptor.

I am not sure if this is the best anglosaxon name for the
function, no other managed resources have an equivalent
currently, but I chose "unhinge" as the closest intuitive
thing I could imagine that fits Rusty Russell's API design
criterions "the obvious use is the correct one" and
"the name tells you how to use it".

The idea came out of a remark from Mark Brown that it should
be possible to handle over management of a resource from
devres to the regulator core, and indeed we can do that.

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>
Documentation/driver-model/devres.txt
drivers/gpio/gpiolib-devres.c
include/linux/gpio/consumer.h