drm/i915/pmdemand: convert to_intel_pmdemand_state() to a function
authorJani Nikula <jani.nikula@intel.com>
Tue, 31 Dec 2024 16:27:37 +0000 (18:27 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 7 Jan 2025 17:31:38 +0000 (19:31 +0200)
In preparation for making struct intel_pmdemand_state an opaque type,
convert to_intel_pmdemand_state() to a function.

Cc: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/10324781f9f7eae5a92506aaa7a40403efd345dd.1735662324.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_pmdemand.c
drivers/gpu/drm/i915/display/intel_pmdemand.h

index cdd314956a319422c3e6fa8ab27b2df88a8be2af..69b40b3735b3da4c51c0f185ccda0b6dd8306742 100644 (file)
 #include "intel_pmdemand.h"
 #include "skl_watermark.h"
 
+struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state)
+{
+       return container_of(obj_state, struct intel_pmdemand_state, base);
+}
+
 static struct intel_global_state *
 intel_pmdemand_duplicate_state(struct intel_global_obj *obj)
 {
index a1c49efdc493218d831ebb63a1909314b126d1a0..89296364ec3bd1164ab80e0badf40b6ad0cc7dff 100644 (file)
@@ -43,8 +43,7 @@ struct intel_pmdemand_state {
        struct pmdemand_params params;
 };
 
-#define to_intel_pmdemand_state(global_state) \
-       container_of_const((global_state), struct intel_pmdemand_state, base)
+struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state);
 
 void intel_pmdemand_init_early(struct drm_i915_private *i915);
 int intel_pmdemand_init(struct drm_i915_private *i915);