Message ID | 20250128-cocci-memory-api-v1-2-0d1609a29587@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm: Move to using devm_platform_ioremap_resource | expand |
On Tue, Jan 28, 2025 at 05:29:26PM -0500, Anusha Srivatsa wrote: > Replace platform_get_resource + devm_ioremap_resource > with just devm_platform_ioremap_resource() > > Used Coccinelle to do this change. SmPl patch: > @rule_1@ > identifier res; > expression ioremap_res; > identifier pdev; > @@ > -struct resource *res; > ... > -res = platform_get_resource(pdev,...); > -ioremap_res = devm_ioremap_resource(...); > +ioremap_res = devm_platform_ioremap_resource(pdev,0); > > Cc: Stefan Agner <stefan@agner.ch> > Cc: Alison Wang <alison.wang@nxp.com> > Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Maxime
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 03b076db9381a5db0bff6576cda2772495a61fed..3bbfc1b56a6557e2f54d2b7ed099531053871341 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -260,7 +260,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) struct fsl_dcu_drm_device *fsl_dev; struct drm_device *drm; struct device *dev = &pdev->dev; - struct resource *res; void __iomem *base; struct clk *pix_clk_in; char pix_clk_name[32]; @@ -278,8 +277,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) return -ENODEV; fsl_dev->soc = id->data; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) { ret = PTR_ERR(base); return ret;
Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Stefan Agner <stefan@agner.ch> Cc: Alison Wang <alison.wang@nxp.com> Signed-off-by: Anusha Srivatsa <asrivats@redhat.com> --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)