Commit 31a01db1 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dp: parse DT from dp_parser_get

It makes little sense to split the submodule get and actual DT parsing.
Call dp_parser_parse() directly from dp_parser_get(), so that the parser
data is fully initialised once it is returned to the caller.
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: default avatarKuogee Hsieh <quic_khsieh@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/576101/
Link: https://lore.kernel.org/r/20240126-dp-power-parser-cleanup-v3-3-098d5f581dd3@linaro.org
parent 9aeb50ea
...@@ -1267,12 +1267,6 @@ static int dp_display_probe(struct platform_device *pdev) ...@@ -1267,12 +1267,6 @@ static int dp_display_probe(struct platform_device *pdev)
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
rc = dp->parser->parse(dp->parser);
if (rc) {
DRM_ERROR("device tree parsing failed\n");
goto err;
}
rc = dp_power_client_init(dp->power); rc = dp_power_client_init(dp->power);
if (rc) { if (rc) {
DRM_ERROR("Power client create failed\n"); DRM_ERROR("Power client create failed\n");
......
...@@ -315,13 +315,19 @@ static int dp_parser_parse(struct dp_parser *parser) ...@@ -315,13 +315,19 @@ static int dp_parser_parse(struct dp_parser *parser)
struct dp_parser *dp_parser_get(struct platform_device *pdev) struct dp_parser *dp_parser_get(struct platform_device *pdev)
{ {
struct dp_parser *parser; struct dp_parser *parser;
int ret;
parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL); parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL);
if (!parser) if (!parser)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
parser->parse = dp_parser_parse;
parser->pdev = pdev; parser->pdev = pdev;
ret = dp_parser_parse(parser);
if (ret) {
dev_err(&pdev->dev, "device tree parsing failed\n");
return ERR_PTR(ret);
}
return parser; return parser;
} }
...@@ -67,7 +67,6 @@ struct dss_module_power { ...@@ -67,7 +67,6 @@ struct dss_module_power {
* *
* @pdev: platform data of the client * @pdev: platform data of the client
* @mp: gpio, regulator and clock related data * @mp: gpio, regulator and clock related data
* @parse: function to be called by client to parse device tree.
*/ */
struct dp_parser { struct dp_parser {
struct platform_device *pdev; struct platform_device *pdev;
...@@ -76,8 +75,6 @@ struct dp_parser { ...@@ -76,8 +75,6 @@ struct dp_parser {
u32 max_dp_lanes; u32 max_dp_lanes;
u32 max_dp_link_rate; u32 max_dp_link_rate;
struct drm_bridge *next_bridge; struct drm_bridge *next_bridge;
int (*parse)(struct dp_parser *parser);
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment