[Freedreno] [PATCH v3 3/5] drm/msm: split the main platform driver
Stephen Boyd
swboyd at chromium.org
Tue Mar 8 20:31:10 UTC 2022
Quoting Dmitry Baryshkov (2022-03-03 19:21:04)
> diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
> index 857eefbb8649..c89de88ed2d1 100644
> --- a/drivers/gpu/drm/msm/msm_mdss.c
> +++ b/drivers/gpu/drm/msm/msm_mdss.c
> @@ -255,3 +258,170 @@ struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5)
[...]
> +
> +static int mdss_probe(struct platform_device *pdev)
> +{
> + struct msm_mdss *mdss;
> + struct msm_drm_private *priv;
> + int mdp_ver = get_mdp_ver(pdev);
> + struct device *mdp_dev;
> + struct device *dev = &pdev->dev;
> + int ret;
> +
> + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, priv);
Is this set here so that msm_mdss_init() can use it? Can we pass 'priv'
as an argument to that function if so?
> +
> + mdss = msm_mdss_init(pdev, mdp_ver == KMS_MDP5);
> + if (IS_ERR(mdss)) {
> + ret = PTR_ERR(mdss);
> + platform_set_drvdata(pdev, NULL);
Is this platform_set_drvdata to NULL really necessary? It would be nice
to skip it so the mental load of this probe is lower.
> +
> + return ret;
> + }
> +
More information about the Freedreno
mailing list