public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister()
@ 2022-06-22 17:11 Andy Shevchenko
  2022-06-22 17:24 ` Uwe Kleine-König
  2022-06-22 23:14 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-06-22 17:11 UTC (permalink / raw)
  To: Stephen Boyd, linux-clk, linux-kernel
  Cc: Michael Turquette, Uwe Kleine-König, Andy Shevchenko

For the entire history of the devm_clk_*unregister() existence they were
used only once (*) in 2015. Remove them.

*) The commit 264e3b75de4e ("clk: s2mps11: Simplify s2mps11_clk_probe unwind
   paths") exactly supports the point of the change proposed here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: removed now unused match() functions as well
 drivers/clk/clk.c            | 48 ------------------------------------
 include/linux/clk-provider.h |  2 --
 2 files changed, 50 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index f00d4c1158d7..7fc191c15507 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -4279,54 +4279,6 @@ int devm_clk_hw_register(struct device *dev, struct clk_hw *hw)
 }
 EXPORT_SYMBOL_GPL(devm_clk_hw_register);
 
-static int devm_clk_match(struct device *dev, void *res, void *data)
-{
-	struct clk *c = res;
-	if (WARN_ON(!c))
-		return 0;
-	return c == data;
-}
-
-static int devm_clk_hw_match(struct device *dev, void *res, void *data)
-{
-	struct clk_hw *hw = res;
-
-	if (WARN_ON(!hw))
-		return 0;
-	return hw == data;
-}
-
-/**
- * devm_clk_unregister - resource managed clk_unregister()
- * @dev: device that is unregistering the clock data
- * @clk: clock to unregister
- *
- * Deallocate a clock allocated with devm_clk_register(). Normally
- * this function will not need to be called and the resource management
- * code will ensure that the resource is freed.
- */
-void devm_clk_unregister(struct device *dev, struct clk *clk)
-{
-	WARN_ON(devres_release(dev, devm_clk_unregister_cb, devm_clk_match, clk));
-}
-EXPORT_SYMBOL_GPL(devm_clk_unregister);
-
-/**
- * devm_clk_hw_unregister - resource managed clk_hw_unregister()
- * @dev: device that is unregistering the hardware-specific clock data
- * @hw: link to hardware-specific clock data
- *
- * Unregister a clk_hw registered with devm_clk_hw_register(). Normally
- * this function will not need to be called and the resource management
- * code will ensure that the resource is freed.
- */
-void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw)
-{
-	WARN_ON(devres_release(dev, devm_clk_hw_unregister_cb, devm_clk_hw_match,
-				hw));
-}
-EXPORT_SYMBOL_GPL(devm_clk_hw_unregister);
-
 static void devm_clk_release(struct device *dev, void *res)
 {
 	clk_put(*(struct clk **)res);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index c10dc4c659e2..72d937c03a3e 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -1176,10 +1176,8 @@ int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
 int __must_check of_clk_hw_register(struct device_node *node, struct clk_hw *hw);
 
 void clk_unregister(struct clk *clk);
-void devm_clk_unregister(struct device *dev, struct clk *clk);
 
 void clk_hw_unregister(struct clk_hw *hw);
-void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw);
 
 /* helper functions */
 const char *__clk_get_name(const struct clk *clk);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister()
  2022-06-22 17:11 [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister() Andy Shevchenko
@ 2022-06-22 17:24 ` Uwe Kleine-König
  2022-06-22 23:14 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2022-06-22 17:24 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Stephen Boyd, linux-clk, linux-kernel, Michael Turquette

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

Hello,

On Wed, Jun 22, 2022 at 08:11:47PM +0300, Andy Shevchenko wrote:
> For the entire history of the devm_clk_*unregister() existence they were
> used only once (*) in 2015. Remove them.
> 
> *) The commit 264e3b75de4e ("clk: s2mps11: Simplify s2mps11_clk_probe unwind
>    paths") exactly supports the point of the change proposed here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Nice

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister()
  2022-06-22 17:11 [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister() Andy Shevchenko
  2022-06-22 17:24 ` Uwe Kleine-König
@ 2022-06-22 23:14 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2022-06-22 23:14 UTC (permalink / raw)
  To: Andy Shevchenko, linux-clk, linux-kernel
  Cc: Michael Turquette, Uwe Kleine-König, Andy Shevchenko

Quoting Andy Shevchenko (2022-06-22 10:11:47)
> For the entire history of the devm_clk_*unregister() existence they were
> used only once (*) in 2015. Remove them.
> 
> *) The commit 264e3b75de4e ("clk: s2mps11: Simplify s2mps11_clk_probe unwind
>    paths") exactly supports the point of the change proposed here.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-22 23:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 17:11 [PATCH v2 1/1] clk: Remove never used devm_clk_*unregister() Andy Shevchenko
2022-06-22 17:24 ` Uwe Kleine-König
2022-06-22 23:14 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox