]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmem: release the write-protect pin
authorKhouloud Touil <ktouil@baylibre.com>
Tue, 10 Mar 2020 13:22:50 +0000 (13:22 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Apr 2020 07:11:07 +0000 (09:11 +0200)
commitede3d1cd27afc4a0381bfff1660fc89c598c982f
tree61b26daaeead70a069242e5779fae8b1d430d858
parentc9f816ed6ae5e552bd3810db95e35af853bc38c4
nvmem: release the write-protect pin

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@linux-m68k.org>
Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
Cc: stable <stable@vger.kernel.org>
[Bartosz: tweak the commit message]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200310132257.23358-8-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c