]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/vc4: move to devm_platform_ioremap_resource() usage
authorAnusha Srivatsa <asrivats@redhat.com>
Tue, 25 Feb 2025 22:20:52 +0000 (17:20 -0500)
committerMaxime Ripard <mripard@kernel.org>
Wed, 26 Feb 2025 14:27:08 +0000 (15:27 +0100)
commitb93f07cf090af2fac40657747515202a7cd156e9
tree243bb5d264ef74dae73f104c9b6abb0e5d7df277
parent41cb3e2150190359b2cb325ea1964870ba620709
drm/vc4: move to devm_platform_ioremap_resource() usage

Replace platform_get_resource_byname + devm_ioremap_resource
with just devm_platform_ioremap_resource()

Used Coccinelle to do this change. SmPl patch:
//rule s/(devm_)platform_get_resource_byname +
//(devm_)ioremap/devm_platform_ioremap_resource.
@rule_3@
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);
...+>

v2: Change the SmPl patch to work on multiple occurences of
the pattern. This also fixes the compilation error.

v3: Do not convert "hd" resource to follow the rest of the
refactor. (Maxime)

v4: fix compiler error

Cc: Maxime Ripard <mripard@kernel.org>
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: MaĆ­ra Canal <mcanal@igalia.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250225-memory-drm-misc-next-v1-11-9d0e8761107a@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/vc4/vc4_hdmi.c