On Thu, 7 Sept 2023 at 01:17, Stephen Boyd <swboyd@xxxxxxxxxxxx> wrote: > > 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. Unfortunately :-( > > > + return ERR_PTR(-ENOMEM); > > + > > + return ptr; > > +} -- With best wishes Dmitry