Skip to content

Commit 429783c

Browse files
committed
drm/msm/dp: drop struct msm_dp_panel_in
All other submodules pass arguments directly. Drop struct msm_dp_panel_in that is used to wrap dp_panel's submodule args and pass all data to msm_dp_panel_get() directly. Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Tested-by: Stephen Boyd <swboyd@chromium.org> # sc7180-trogdor Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/629055/ Link: https://lore.kernel.org/r/20241216-fd-dp-audio-fixup-v4-4-f8d1961cf22f@linaro.org
1 parent c0caebf commit 429783c

3 files changed

Lines changed: 11 additions & 23 deletions

File tree

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,6 @@ static int msm_dp_init_sub_modules(struct msm_dp_display_private *dp)
722722
{
723723
int rc = 0;
724724
struct device *dev = &dp->msm_dp_display.pdev->dev;
725-
struct msm_dp_panel_in panel_in = {
726-
.dev = dev,
727-
};
728725
struct phy *phy;
729726

730727
phy = devm_phy_get(dev, "dp");
@@ -765,11 +762,7 @@ static int msm_dp_init_sub_modules(struct msm_dp_display_private *dp)
765762
goto error_link;
766763
}
767764

768-
panel_in.aux = dp->aux;
769-
panel_in.catalog = dp->catalog;
770-
panel_in.link = dp->link;
771-
772-
dp->panel = msm_dp_panel_get(&panel_in);
765+
dp->panel = msm_dp_panel_get(dev, dp->aux, dp->link, dp->catalog);
773766
if (IS_ERR(dp->panel)) {
774767
rc = PTR_ERR(dp->panel);
775768
DRM_ERROR("failed to initialize panel, rc = %d\n", rc);

drivers/gpu/drm/msm/dp/dp_panel.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,25 +475,26 @@ static int msm_dp_panel_parse_dt(struct msm_dp_panel *msm_dp_panel)
475475
return 0;
476476
}
477477

478-
struct msm_dp_panel *msm_dp_panel_get(struct msm_dp_panel_in *in)
478+
struct msm_dp_panel *msm_dp_panel_get(struct device *dev, struct drm_dp_aux *aux,
479+
struct msm_dp_link *link, struct msm_dp_catalog *catalog)
479480
{
480481
struct msm_dp_panel_private *panel;
481482
struct msm_dp_panel *msm_dp_panel;
482483
int ret;
483484

484-
if (!in->dev || !in->catalog || !in->aux || !in->link) {
485+
if (!dev || !catalog || !aux || !link) {
485486
DRM_ERROR("invalid input\n");
486487
return ERR_PTR(-EINVAL);
487488
}
488489

489-
panel = devm_kzalloc(in->dev, sizeof(*panel), GFP_KERNEL);
490+
panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
490491
if (!panel)
491492
return ERR_PTR(-ENOMEM);
492493

493-
panel->dev = in->dev;
494-
panel->aux = in->aux;
495-
panel->catalog = in->catalog;
496-
panel->link = in->link;
494+
panel->dev = dev;
495+
panel->aux = aux;
496+
panel->catalog = catalog;
497+
panel->link = link;
497498

498499
msm_dp_panel = &panel->msm_dp_panel;
499500
msm_dp_panel->max_bw_code = DP_LINK_BW_8_1;

drivers/gpu/drm/msm/dp/dp_panel.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ struct msm_dp_display_mode {
2121
bool out_fmt_is_yuv_420;
2222
};
2323

24-
struct msm_dp_panel_in {
25-
struct device *dev;
26-
struct drm_dp_aux *aux;
27-
struct msm_dp_link *link;
28-
struct msm_dp_catalog *catalog;
29-
};
30-
3124
struct msm_dp_panel_psr {
3225
u8 version;
3326
u8 capabilities;
@@ -91,6 +84,7 @@ static inline bool is_lane_count_valid(u32 lane_count)
9184
lane_count == 4);
9285
}
9386

94-
struct msm_dp_panel *msm_dp_panel_get(struct msm_dp_panel_in *in);
87+
struct msm_dp_panel *msm_dp_panel_get(struct device *dev, struct drm_dp_aux *aux,
88+
struct msm_dp_link *link, struct msm_dp_catalog *catalog);
9589
void msm_dp_panel_put(struct msm_dp_panel *msm_dp_panel);
9690
#endif /* _DP_PANEL_H_ */

0 commit comments

Comments
 (0)