[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200217135245.29195-1-ktouil@baylibre.com>
Date: Mon, 17 Feb 2020 14:52:45 +0100
From: Khouloud Touil <ktouil@...libre.com>
To: srinivas.kandagatla@...aro.org, bgolaszewski@...libre.com
Cc: linus.walleij@...aro.org, linux-kernel@...r.kernel.org,
geert@...ux-m68k.org, baylibre-upstreaming@...ups.io,
Khouloud Touil <ktouil@...libre.com>
Subject: [PATCH] nvmem: release the write-protect pin
Implement the auto-release of the write-protect pin that when the
registration fails, it's auto-released.
Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin")
Reported-by: geert@...ux-m68k.org
Signed-off-by: Khouloud Touil <ktouil@...libre.com>
---
drivers/nvmem/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index ef326f243f36..5f1988498d75 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -72,6 +72,7 @@ static void nvmem_release(struct device *dev)
struct nvmem_device *nvmem = to_nvmem_device(dev);
ida_simple_remove(&nvmem_ida, nvmem->id);
+ gpiod_put(nvmem->wp_gpio);
kfree(nvmem);
}
--
2.17.1
Powered by blists - more mailing lists