[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180907100750.14564-8-brgl@bgdev.pl>
Date: Fri, 7 Sep 2018 12:07:41 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
"David S . Miller" <davem@...emloft.net>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Jonathan Corbet <corbet@....net>, Sekhar Nori <nsekhar@...com>,
Kevin Hilman <khilman@...nel.org>,
David Lechner <david@...hnology.com>,
Boris Brezillon <boris.brezillon@...tlin.com>,
Andrew Lunn <andrew@...n.ch>, Alban Bedel <albeu@...e.fr>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Chen-Yu Tsai <wens@...e.org>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH v2 07/16] nvmem: change the signature of nvmem_unregister()
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
This function can no longer fail and there are no more users that check
it return value. Change it to return void.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
drivers/nvmem/core.c | 8 ++------
include/linux/nvmem-provider.h | 9 +++------
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 2335b72d4b3e..89b91f73d08a 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -450,20 +450,16 @@ static void nvmem_device_release(struct kref *kref)
* nvmem_unregister() - Unregister previously registered nvmem device
*
* @nvmem: Pointer to previously registered nvmem device.
- *
- * Return: Will be an negative on error or a zero on success.
*/
-int nvmem_unregister(struct nvmem_device *nvmem)
+void nvmem_unregister(struct nvmem_device *nvmem)
{
kref_put(&nvmem->refcnt, nvmem_device_release);
-
- return 0;
}
EXPORT_SYMBOL_GPL(nvmem_unregister);
static void devm_nvmem_release(struct device *dev, void *res)
{
- WARN_ON(nvmem_unregister(*(struct nvmem_device **)res));
+ nvmem_unregister(*(struct nvmem_device **)res);
}
/**
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index cc8556e3c825..d14a577a002d 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -67,7 +67,7 @@ struct nvmem_config {
#if IS_ENABLED(CONFIG_NVMEM)
struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
-int nvmem_unregister(struct nvmem_device *nvmem);
+void nvmem_unregister(struct nvmem_device *nvmem);
struct nvmem_device *devm_nvmem_register(struct device *dev,
const struct nvmem_config *cfg);
@@ -81,10 +81,7 @@ static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
return ERR_PTR(-ENOSYS);
}
-static inline int nvmem_unregister(struct nvmem_device *nvmem)
-{
- return -ENOSYS;
-}
+static inline void nvmem_unregister(struct nvmem_device *nvmem) {}
static inline struct nvmem_device *
devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
@@ -95,7 +92,7 @@ devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
static inline int
devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
{
- return nvmem_unregister(nvmem);
+ return ERR_PTR(-ENOSYS);
}
--
2.18.0
Powered by blists - more mailing lists