regulator: core: Actually put the gpiod after use

I went to great lengths to hand over the management of the GPIO
descriptors to the regulator core, and some stray rebased
oneliner in the old patch must have been assuming the devices
were still doing devres management of it.

We handed the management over to the regulator core, so of
course the regulator core shall issue gpiod_put() when done.

Sorry for the descriptor leak.

Fixes: 541d052d72 ("regulator: core: Only support passing enable GPIO descriptors")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Linus Walleij 2019-04-20 13:34:30 +02:00 коммит произвёл Mark Brown
Родитель 063773011d
Коммит 78927aa40b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -2256,6 +2256,7 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->gpiod == rdev->ena_pin->gpiod) {
if (pin->request_count <= 1) { if (pin->request_count <= 1) {
pin->request_count = 0; pin->request_count = 0;
gpiod_put(pin->gpiod);
list_del(&pin->list); list_del(&pin->list);
kfree(pin); kfree(pin);
rdev->ena_pin = NULL; rdev->ena_pin = NULL;