[PATCH v4 3/3] PM: runtime: Drop DEFINE_FREE() for pm_runtime_put()

Rafael J. Wysocki posted 3 patches 5 days, 6 hours ago
[PATCH v4 3/3] PM: runtime: Drop DEFINE_FREE() for pm_runtime_put()
Posted by Rafael J. Wysocki 5 days, 6 hours ago
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The DEFINE_FREE() for pm_runtime_put has been superseded by recently
introduced runtime PM auto-cleanup macros and its only user has been
converted to using one of the new macros, so drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
---

v3 -> v4: Pick up R-by from Dhruva

v1 -> v3: No changes

---
 include/linux/pm_runtime.h |    2 --
 rust/kernel/cpufreq.rs     |    3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)

--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -561,8 +561,6 @@ static inline int pm_runtime_put(struct
 	return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
 }
 
-DEFINE_FREE(pm_runtime_put, struct device *, if (_T) pm_runtime_put(_T))
-
 /**
  * __pm_runtime_put_autosuspend - Drop device usage counter and queue autosuspend if 0.
  * @dev: Target device.
--- a/rust/kernel/cpufreq.rs
+++ b/rust/kernel/cpufreq.rs
@@ -39,7 +39,8 @@ use macros::vtable;
 const CPUFREQ_NAME_LEN: usize = bindings::CPUFREQ_NAME_LEN as usize;
 
 /// Default transition latency value in nanoseconds.
-pub const ETERNAL_LATENCY_NS: u32 = bindings::CPUFREQ_ETERNAL as u32;
+pub const DEFAULT_TRANSITION_LATENCY_NS: u32 =
+    bindings::CPUFREQ_DEFAULT_TRANSITION_LATENCY_NS as u32;
 
 /// CPU frequency driver flags.
 pub mod flags {
Re: [PATCH v4 3/3] PM: runtime: Drop DEFINE_FREE() for pm_runtime_put()
Posted by Rafael J. Wysocki 5 days, 5 hours ago
On Fri, Sep 26, 2025 at 6:27 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The DEFINE_FREE() for pm_runtime_put has been superseded by recently
> introduced runtime PM auto-cleanup macros and its only user has been
> converted to using one of the new macros, so drop it.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Reviewed-by: Dhruva Gole <d-gole@ti.com>
> ---
>
> v3 -> v4: Pick up R-by from Dhruva
>
> v1 -> v3: No changes
>
> ---
>  include/linux/pm_runtime.h |    2 --
>  rust/kernel/cpufreq.rs     |    3 ++-
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -561,8 +561,6 @@ static inline int pm_runtime_put(struct
>         return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
>  }
>
> -DEFINE_FREE(pm_runtime_put, struct device *, if (_T) pm_runtime_put(_T))
> -
>  /**
>   * __pm_runtime_put_autosuspend - Drop device usage counter and queue autosuspend if 0.
>   * @dev: Target device.

The hunk below does not belong to this patch.  It was added here by
mistake, sorry about that.

> --- a/rust/kernel/cpufreq.rs
> +++ b/rust/kernel/cpufreq.rs
> @@ -39,7 +39,8 @@ use macros::vtable;
>  const CPUFREQ_NAME_LEN: usize = bindings::CPUFREQ_NAME_LEN as usize;
>
>  /// Default transition latency value in nanoseconds.
> -pub const ETERNAL_LATENCY_NS: u32 = bindings::CPUFREQ_ETERNAL as u32;
> +pub const DEFAULT_TRANSITION_LATENCY_NS: u32 =
> +    bindings::CPUFREQ_DEFAULT_TRANSITION_LATENCY_NS as u32;
>
>  /// CPU frequency driver flags.
>  pub mod flags {