Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/stm: move to devm_platform_ioremap_resource() usage

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: Yannick Fertre <yannick.fertre@foss.st.com>
Cc: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Cc: Philippe Cornu <philippe.cornu@foss.st.com>
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Acked-by: Raphaël Gallais-Pou <raphael.gallais-pou@foss.st.com>
Link: https://lore.kernel.org/r/20250225-memory-drm-misc-next-v1-8-9d0e8761107a@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>

authored by

Anusha Srivatsa and committed by
Maxime Ripard
50cc9a32 555313ff

+1 -3
+1 -3
drivers/gpu/drm/stm/ltdc.c
··· 1900 1900 struct drm_panel *panel; 1901 1901 struct drm_crtc *crtc; 1902 1902 struct reset_control *rstc; 1903 - struct resource *res; 1904 1903 int irq, i, nb_endpoints; 1905 1904 int ret = -ENODEV; 1906 1905 ··· 1965 1966 reset_control_deassert(rstc); 1966 1967 } 1967 1968 1968 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1969 - ldev->regs = devm_ioremap_resource(dev, res); 1969 + ldev->regs = devm_platform_ioremap_resource(pdev, 0); 1970 1970 if (IS_ERR(ldev->regs)) { 1971 1971 DRM_ERROR("Unable to get ltdc registers\n"); 1972 1972 ret = PTR_ERR(ldev->regs);