]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/sti: move to devm_platform_ioremap_resource() usage
authorAnusha Srivatsa <asrivats@redhat.com>
Tue, 4 Mar 2025 21:05:35 +0000 (16:05 -0500)
committerAnusha Srivatsa <asrivats@asrivats-thinkpadt14sgen2i.rmtustx.csb>
Mon, 10 Mar 2025 20:25:26 +0000 (16:25 -0400)
commit67c4ea8267cf015653610278e0dc36c58e9a7363
treed2f0ef3fd5b004bfa6c6ce84e739daa53ca7912b
parent92b8f062a620b1231cc7aef06be871b88b771123
drm/sti: move to devm_platform_ioremap_resource() usage

Replace platform_get_resource/_byname + devm_ioremap
with just devm_platform_ioremap_resource()

Used Coccinelle to do this change. SmPl patch:

@rule@
identifier res;
expression ioremap;
identifier pdev;
constant mem;
expression name;
@@
-struct resource *res;
...
-res = platform_get_resource_byname(pdev,mem,name);
<...
-if (!res) {
-...
-}
...>
-ioremap = devm_ioremap(...);
+ioremap = devm_platform_ioremap_resource_byname(pdev,name);

and
@rule_2@
identifier res;
expression ioremap;
identifier pdev;
@@
-struct resource *res;
...
-res = platform_get_resource(pdev,...);
<...
-if (!res) {
-...
-}
...>
-ioremap = devm_ioremap(...);
+ioremap = devm_platform_ioremap_resource(pdev,0);

v2: Fix compilation error.
v3: Handle returns properly since the new API return error pointers
and not NULL

Cc: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Cc: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>(v2)
Acked-by: Raphael Gallais-Pou <rgallaispou@gmail.com>(v2)
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://patchwork.freedesktop.org/patch/640854/?series=144073&rev=5
drivers/gpu/drm/sti/sti_compositor.c
drivers/gpu/drm/sti/sti_dvo.c
drivers/gpu/drm/sti/sti_hda.c
drivers/gpu/drm/sti/sti_hdmi.c
drivers/gpu/drm/sti/sti_hqvdp.c
drivers/gpu/drm/sti/sti_tvout.c
drivers/gpu/drm/sti/sti_vtg.c