[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200407101454.643321516@linuxfoundation.org>
Date: Tue, 7 Apr 2020 12:22:18 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Geert Uytterhoeven <geert@...ux-m68k.org>,
Khouloud Touil <ktouil@...libre.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH 5.6 21/29] nvmem: release the write-protect pin
From: Khouloud Touil <ktouil@...libre.com>
commit a9c3766cb19cdadf2776aba41b64470002645894 upstream.
Put the write-protect GPIO descriptor in nvmem_release() so that it can
be automatically released when the associated device's reference count
drops to 0.
Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin")
Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Khouloud Touil <ktouil@...libre.com>
Cc: stable <stable@...r.kernel.org>
[Bartosz: tweak the commit message]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Link: https://lore.kernel.org/r/20200310132257.23358-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/nvmem/core.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -72,6 +72,7 @@ static void nvmem_release(struct device
struct nvmem_device *nvmem = to_nvmem_device(dev);
ida_simple_remove(&nvmem_ida, nvmem->id);
+ gpiod_put(nvmem->wp_gpio);
kfree(nvmem);
}
Powered by blists - more mailing lists