* [PATCH] PM: clk: Remove unused pm_clk_remove
@ 2025-03-07 21:23 linux
2025-03-12 20:29 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: linux @ 2025-03-07 21:23 UTC (permalink / raw)
To: rafael, len.brown, pavel
Cc: gregkh, dakr, linux-pm, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
pm_clk_remove() is currently unused.
It hasn't been used since at least 2011 when it was renamed from
pm_runtime_clk_remove by
commit 3d5c30367cbc ("PM: Rename clock management functions")
Remove it.
Note that the __pm_clk_remove is still used and is left in.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/base/power/clock_ops.c | 40 ----------------------------------
include/linux/pm_clock.h | 4 ----
2 files changed, 44 deletions(-)
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 97a53215a274..b69bcb37c830 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -343,46 +343,6 @@ static void __pm_clk_remove(struct pm_clock_entry *ce)
kfree(ce);
}
-/**
- * pm_clk_remove - Stop using a device clock for power management.
- * @dev: Device whose clock should not be used for PM any more.
- * @con_id: Connection ID of the clock.
- *
- * Remove the clock represented by @con_id from the list of clocks used for
- * the power management of @dev.
- */
-void pm_clk_remove(struct device *dev, const char *con_id)
-{
- struct pm_subsys_data *psd = dev_to_psd(dev);
- struct pm_clock_entry *ce;
-
- if (!psd)
- return;
-
- pm_clk_list_lock(psd);
-
- list_for_each_entry(ce, &psd->clock_list, node) {
- if (!con_id && !ce->con_id)
- goto remove;
- else if (!con_id || !ce->con_id)
- continue;
- else if (!strcmp(con_id, ce->con_id))
- goto remove;
- }
-
- pm_clk_list_unlock(psd);
- return;
-
- remove:
- list_del(&ce->node);
- if (ce->enabled_when_prepared)
- psd->clock_op_might_sleep--;
- pm_clk_list_unlock(psd);
-
- __pm_clk_remove(ce);
-}
-EXPORT_SYMBOL_GPL(pm_clk_remove);
-
/**
* pm_clk_remove_clk - Stop using a device clock for power management.
* @dev: Device whose clock should not be used for PM any more.
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
index 45c3f3ccbaf8..c3b46fa358d3 100644
--- a/include/linux/pm_clock.h
+++ b/include/linux/pm_clock.h
@@ -42,7 +42,6 @@ extern void pm_clk_destroy(struct device *dev);
extern int pm_clk_add(struct device *dev, const char *con_id);
extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
extern int of_pm_clk_add_clks(struct device *dev);
-extern void pm_clk_remove(struct device *dev, const char *con_id);
extern void pm_clk_remove_clk(struct device *dev, struct clk *clk);
extern int pm_clk_suspend(struct device *dev);
extern int pm_clk_resume(struct device *dev);
@@ -75,9 +74,6 @@ static inline int of_pm_clk_add_clks(struct device *dev)
{
return -EINVAL;
}
-static inline void pm_clk_remove(struct device *dev, const char *con_id)
-{
-}
#define pm_clk_suspend NULL
#define pm_clk_resume NULL
static inline void pm_clk_remove_clk(struct device *dev, struct clk *clk)
--
2.48.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] PM: clk: Remove unused pm_clk_remove
2025-03-07 21:23 [PATCH] PM: clk: Remove unused pm_clk_remove linux
@ 2025-03-12 20:29 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2025-03-12 20:29 UTC (permalink / raw)
To: linux; +Cc: rafael, len.brown, pavel, gregkh, dakr, linux-pm, linux-kernel
On Fri, Mar 7, 2025 at 10:23 PM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> pm_clk_remove() is currently unused.
> It hasn't been used since at least 2011 when it was renamed from
> pm_runtime_clk_remove by
> commit 3d5c30367cbc ("PM: Rename clock management functions")
>
> Remove it.
>
> Note that the __pm_clk_remove is still used and is left in.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
> drivers/base/power/clock_ops.c | 40 ----------------------------------
> include/linux/pm_clock.h | 4 ----
> 2 files changed, 44 deletions(-)
>
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index 97a53215a274..b69bcb37c830 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -343,46 +343,6 @@ static void __pm_clk_remove(struct pm_clock_entry *ce)
> kfree(ce);
> }
>
> -/**
> - * pm_clk_remove - Stop using a device clock for power management.
> - * @dev: Device whose clock should not be used for PM any more.
> - * @con_id: Connection ID of the clock.
> - *
> - * Remove the clock represented by @con_id from the list of clocks used for
> - * the power management of @dev.
> - */
> -void pm_clk_remove(struct device *dev, const char *con_id)
> -{
> - struct pm_subsys_data *psd = dev_to_psd(dev);
> - struct pm_clock_entry *ce;
> -
> - if (!psd)
> - return;
> -
> - pm_clk_list_lock(psd);
> -
> - list_for_each_entry(ce, &psd->clock_list, node) {
> - if (!con_id && !ce->con_id)
> - goto remove;
> - else if (!con_id || !ce->con_id)
> - continue;
> - else if (!strcmp(con_id, ce->con_id))
> - goto remove;
> - }
> -
> - pm_clk_list_unlock(psd);
> - return;
> -
> - remove:
> - list_del(&ce->node);
> - if (ce->enabled_when_prepared)
> - psd->clock_op_might_sleep--;
> - pm_clk_list_unlock(psd);
> -
> - __pm_clk_remove(ce);
> -}
> -EXPORT_SYMBOL_GPL(pm_clk_remove);
> -
> /**
> * pm_clk_remove_clk - Stop using a device clock for power management.
> * @dev: Device whose clock should not be used for PM any more.
> diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
> index 45c3f3ccbaf8..c3b46fa358d3 100644
> --- a/include/linux/pm_clock.h
> +++ b/include/linux/pm_clock.h
> @@ -42,7 +42,6 @@ extern void pm_clk_destroy(struct device *dev);
> extern int pm_clk_add(struct device *dev, const char *con_id);
> extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
> extern int of_pm_clk_add_clks(struct device *dev);
> -extern void pm_clk_remove(struct device *dev, const char *con_id);
> extern void pm_clk_remove_clk(struct device *dev, struct clk *clk);
> extern int pm_clk_suspend(struct device *dev);
> extern int pm_clk_resume(struct device *dev);
> @@ -75,9 +74,6 @@ static inline int of_pm_clk_add_clks(struct device *dev)
> {
> return -EINVAL;
> }
> -static inline void pm_clk_remove(struct device *dev, const char *con_id)
> -{
> -}
> #define pm_clk_suspend NULL
> #define pm_clk_resume NULL
> static inline void pm_clk_remove_clk(struct device *dev, struct clk *clk)
> --
Applied as 6.15 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-12 20:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-07 21:23 [PATCH] PM: clk: Remove unused pm_clk_remove linux
2025-03-12 20:29 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®