@@ -184,16 +184,6 @@ struct dpu_hw_ctl {
struct dpu_hw_ctl_ops ops;
};
-/**
- * dpu_hw_ctl - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_ctl *to_dpu_hw_ctl(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_ctl, base);
-}
-
/**
* dpu_hw_ctl_init(): Initializes the ctl_path hw driver object.
* should be called before accessing every ctl path registers.
@@ -91,16 +91,6 @@ struct dpu_hw_intf {
struct dpu_hw_intf_ops ops;
};
-/**
- * to_dpu_hw_intf - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_intf *to_dpu_hw_intf(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_intf, base);
-}
-
/**
* dpu_hw_intf_init(): Initializes the intf driver for the passed
* interface idx.
@@ -85,16 +85,6 @@ struct dpu_hw_mixer {
struct dpu_hw_mixer_cfg cfg;
};
-/**
- * to_dpu_hw_mixer - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_mixer *to_dpu_hw_mixer(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_mixer, base);
-}
-
/**
* dpu_hw_lm_init(): Initializes the mixer hw driver object.
* should be called once before accessing every mixer.
@@ -104,16 +104,6 @@ struct dpu_hw_pingpong {
struct dpu_hw_pingpong_ops ops;
};
-/**
- * dpu_hw_pingpong - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_pingpong *to_dpu_hw_pingpong(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_pingpong, base);
-}
-
/**
* dpu_hw_pingpong_init - initializes the pingpong driver for the passed
* pingpong idx.
@@ -391,16 +391,6 @@ struct dpu_hw_pipe {
struct dpu_hw_sspp_ops ops;
};
-/**
- * dpu_hw_pipe - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_pipe *to_dpu_hw_pipe(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_pipe, base);
-}
-
/**
* dpu_hw_sspp_init - initializes the sspp hw driver object.
* Should be called once before accessing every pipe.
@@ -160,16 +160,6 @@ struct dpu_hw_mdp {
struct dpu_hw_mdp_ops ops;
};
-/**
- * to_dpu_hw_mdp - convert base object dpu_hw_base to container
- * @hw: Pointer to base hardware block
- * return: Pointer to hardware block container
- */
-static inline struct dpu_hw_mdp *to_dpu_hw_mdp(struct dpu_hw_blk *hw)
-{
- return container_of(hw, struct dpu_hw_mdp, base);
-}
-
/**
* dpu_hw_mdptop_init - initializes the top driver for the passed idx
* @idx: Interface index for which driver object is required
@@ -405,6 +405,8 @@ static bool _dpu_rm_needs_split_display(const struct msm_display_topology *top)
return top->num_intf > 1;
}
+#define to_dpu_hw_mixer(hw) container_of((hw), struct dpu_hw_mixer, base)
+
/**
* _dpu_rm_check_lm_and_get_connected_blks - check if proposed layer mixer meets
* proposed use case requirements, incl. hardwired dependent blocks like
@@ -566,7 +568,8 @@ static int _dpu_rm_reserve_ctls(
dpu_rm_init_hw_iter(&iter, 0, DPU_HW_BLK_CTL);
while (_dpu_rm_get_hw_locked(rm, &iter)) {
- const struct dpu_hw_ctl *ctl = to_dpu_hw_ctl(iter.blk->hw);
+ const struct dpu_hw_ctl *ctl =
+ container_of(iter.blk->hw, struct dpu_hw_ctl, base);
unsigned long features = ctl->caps->features;
bool has_split_display;
Cleanup a number of static inline container_of() helper functions because they are either unused or only used in one file and can be performed inline or with a simple #define. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 ++++- 7 files changed, 4 insertions(+), 61 deletions(-)