diff mbox series

[v2,1/5] nvmem: core: Remove unused devm_nvmem_unregister()

Message ID 20220124180040.50660-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v2,1/5] nvmem: core: Remove unused devm_nvmem_unregister() | expand

Commit Message

Andy Shevchenko Jan. 24, 2022, 6 p.m. UTC
There are no users and seems no will come of the devm_nvmem_unregister().
Remove the function and remove the unused devm_nvmem_match() along with it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: removed unused devm_nvmem_match() (lkp)
 drivers/nvmem/core.c           | 22 ----------------------
 include/linux/nvmem-provider.h |  8 --------
 2 files changed, 30 deletions(-)

Comments

Srinivas Kandagatla Jan. 25, 2022, 10:35 a.m. UTC | #1
Thanks Andy for the cleanup,

On 24/01/2022 18:00, Andy Shevchenko wrote:
> There are no users and seems no will come of the devm_nvmem_unregister().
> Remove the function and remove the unused devm_nvmem_match() along with it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


Applied 1/5, 2/5 and 3/5 patches.

Others can go via there own subsystems as I do not see any dependencies.

--srini
> ---
> v2: removed unused devm_nvmem_match() (lkp)
>   drivers/nvmem/core.c           | 22 ----------------------
>   include/linux/nvmem-provider.h |  8 --------
>   2 files changed, 30 deletions(-)
> 
> diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
> index 23a38dcf0fc4..1a70b3bdb71d 100644
> --- a/drivers/nvmem/core.c
> +++ b/drivers/nvmem/core.c
> @@ -945,28 +945,6 @@ struct nvmem_device *devm_nvmem_register(struct device *dev,
>   }
>   EXPORT_SYMBOL_GPL(devm_nvmem_register);
>   
> -static int devm_nvmem_match(struct device *dev, void *res, void *data)
> -{
> -	struct nvmem_device **r = res;
> -
> -	return *r == data;
> -}
> -
> -/**
> - * devm_nvmem_unregister() - Unregister previously registered managed nvmem
> - * device.
> - *
> - * @dev: Device that uses the nvmem device.
> - * @nvmem: Pointer to previously registered nvmem device.
> - *
> - * Return: Will be negative on error or zero on success.
> - */
> -int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
> -{
> -	return devres_release(dev, devm_nvmem_release, devm_nvmem_match, nvmem);
> -}
> -EXPORT_SYMBOL(devm_nvmem_unregister);
> -
>   static struct nvmem_device *__nvmem_device_get(void *data,
>   			int (*match)(struct device *dev, const void *data))
>   {
> diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
> index 98efb7b5660d..99c01c43d7a8 100644
> --- a/include/linux/nvmem-provider.h
> +++ b/include/linux/nvmem-provider.h
> @@ -133,8 +133,6 @@ void nvmem_unregister(struct nvmem_device *nvmem);
>   struct nvmem_device *devm_nvmem_register(struct device *dev,
>   					 const struct nvmem_config *cfg);
>   
> -int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem);
> -
>   void nvmem_add_cell_table(struct nvmem_cell_table *table);
>   void nvmem_del_cell_table(struct nvmem_cell_table *table);
>   
> @@ -153,12 +151,6 @@ devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
>   	return nvmem_register(c);
>   }
>   
> -static inline int
> -devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
> -{
> -	return -EOPNOTSUPP;
> -}
> -
>   static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}
>   static inline void nvmem_del_cell_table(struct nvmem_cell_table *table) {}
>
Andy Shevchenko Jan. 25, 2022, 2:04 p.m. UTC | #2
On Tue, Jan 25, 2022 at 10:35:24AM +0000, Srinivas Kandagatla wrote:
> On 24/01/2022 18:00, Andy Shevchenko wrote:
> > There are no users and seems no will come of the devm_nvmem_unregister().
> > Remove the function and remove the unused devm_nvmem_match() along with it.

> Applied 1/5, 2/5 and 3/5 patches.

Thanks!

> Others can go via there own subsystems as I do not see any dependencies.

They are dependent on the patch 3 ("nvmem: core: Check input parameter for
NULL in nvmem_unregister()"). Since there are tags, can you apply them as
well?
diff mbox series

Patch

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 23a38dcf0fc4..1a70b3bdb71d 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -945,28 +945,6 @@  struct nvmem_device *devm_nvmem_register(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_nvmem_register);
 
-static int devm_nvmem_match(struct device *dev, void *res, void *data)
-{
-	struct nvmem_device **r = res;
-
-	return *r == data;
-}
-
-/**
- * devm_nvmem_unregister() - Unregister previously registered managed nvmem
- * device.
- *
- * @dev: Device that uses the nvmem device.
- * @nvmem: Pointer to previously registered nvmem device.
- *
- * Return: Will be negative on error or zero on success.
- */
-int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
-{
-	return devres_release(dev, devm_nvmem_release, devm_nvmem_match, nvmem);
-}
-EXPORT_SYMBOL(devm_nvmem_unregister);
-
 static struct nvmem_device *__nvmem_device_get(void *data,
 			int (*match)(struct device *dev, const void *data))
 {
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 98efb7b5660d..99c01c43d7a8 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -133,8 +133,6 @@  void nvmem_unregister(struct nvmem_device *nvmem);
 struct nvmem_device *devm_nvmem_register(struct device *dev,
 					 const struct nvmem_config *cfg);
 
-int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem);
-
 void nvmem_add_cell_table(struct nvmem_cell_table *table);
 void nvmem_del_cell_table(struct nvmem_cell_table *table);
 
@@ -153,12 +151,6 @@  devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
 	return nvmem_register(c);
 }
 
-static inline int
-devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem)
-{
-	return -EOPNOTSUPP;
-}
-
 static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}
 static inline void nvmem_del_cell_table(struct nvmem_cell_table *table) {}