Skip to content

Commit eb18e25

Browse files
committed
drm/i915/pmdemand: convert to_intel_pmdemand_state() to a function
In preparation for making struct intel_pmdemand_state an opaque type, convert to_intel_pmdemand_state() to a function. Cc: Gustavo Sousa <[email protected]> Reviewed-by: Gustavo Sousa <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/10324781f9f7eae5a92506aaa7a40403efd345dd.1735662324.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent ef0a075 commit eb18e25

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/gpu/drm/i915/display/intel_pmdemand.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
#include "intel_pmdemand.h"
1616
#include "skl_watermark.h"
1717

18+
struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state)
19+
{
20+
return container_of(obj_state, struct intel_pmdemand_state, base);
21+
}
22+
1823
static struct intel_global_state *
1924
intel_pmdemand_duplicate_state(struct intel_global_obj *obj)
2025
{

drivers/gpu/drm/i915/display/intel_pmdemand.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ struct intel_pmdemand_state {
4343
struct pmdemand_params params;
4444
};
4545

46-
#define to_intel_pmdemand_state(global_state) \
47-
container_of_const((global_state), struct intel_pmdemand_state, base)
46+
struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state);
4847

4948
void intel_pmdemand_init_early(struct drm_i915_private *i915);
5049
int intel_pmdemand_init(struct drm_i915_private *i915);

0 commit comments

Comments
 (0)