[PATCH 3/6] drm/msm/dpu: support binding to the mdp5 devices
Stephen Boyd
swboyd at chromium.org
Wed Sep 6 22:17:00 UTC 2023
Quoting Dmitry Baryshkov (2023-09-05 10:43:50)
> diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
> index 59d2788c4510..9d0d76f3a319 100644
> --- a/drivers/gpu/drm/msm/msm_io_utils.c
> +++ b/drivers/gpu/drm/msm/msm_io_utils.c
> @@ -50,6 +50,24 @@ struct clk *msm_clk_get(struct platform_device *pdev, const char *name)
> return clk;
> }
>
> +void __iomem *msm_ioremap_mdss(struct platform_device *mdss_pdev,
> + struct platform_device *pdev,
> + const char *name)
> +{
> + struct resource *res;
> + void __iomem *ptr;
> +
> + res = platform_get_resource_byname(mdss_pdev, IORESOURCE_MEM, name);
> + if (!res)
> + return ERR_PTR(-EINVAL);
> +
> + ptr = devm_ioremap_resource(&pdev->dev, res);
> + if (!ptr)
devm_ioremap_resource() returns an error pointer. Too bad we can't use
devm_platform_ioremap_resource_byname() here.
> + return ERR_PTR(-ENOMEM);
> +
> + return ptr;
> +}
More information about the dri-devel
mailing list