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: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com> Reviewed-by: Kuogee 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
This commit is contained in:
@@ -1267,12 +1267,6 @@ static int dp_display_probe(struct platform_device *pdev)
|
||||
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);
|
||||
if (rc) {
|
||||
DRM_ERROR("Power client create failed\n");
|
||||
|
||||
@@ -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 *parser;
|
||||
int ret;
|
||||
|
||||
parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL);
|
||||
if (!parser)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
parser->parse = dp_parser_parse;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ struct dss_module_power {
|
||||
*
|
||||
* @pdev: platform data of the client
|
||||
* @mp: gpio, regulator and clock related data
|
||||
* @parse: function to be called by client to parse device tree.
|
||||
*/
|
||||
struct dp_parser {
|
||||
struct platform_device *pdev;
|
||||
@@ -76,8 +75,6 @@ struct dp_parser {
|
||||
u32 max_dp_lanes;
|
||||
u32 max_dp_link_rate;
|
||||
struct drm_bridge *next_bridge;
|
||||
|
||||
int (*parse)(struct dp_parser *parser);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user