public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 00/14] drm: Move to using devm_platform_ioremap_resource
@ 2025-01-28 22:29 Anusha Srivatsa
  2025-01-28 22:29 ` [PATCH 01/14] drm/aspeed: move to devm_platform_ioremap_resource() usage Anusha Srivatsa
                   ` (13 more replies)
  0 siblings, 14 replies; 35+ messages in thread
From: Anusha Srivatsa @ 2025-01-28 22:29 UTC (permalink / raw)
  To: Joel Stanley, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Andrew Jeffery, Stefan Agner,
	Alison Wang, Xinliang Liu, Tian Tao, Xinwei Kong, Sumit Semwal,
	Yongqin Liu, John Stultz, Chun-Kuang Hu, Philipp Zabel,
	Matthias Brugger, AngeloGioacchino Del Regno, Neil Armstrong,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Marek Vasut,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Sandy Huang, Heiko Stübner, Andy Yan, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Alain Volmat, Raphael Gallais-Pou,
	Yannick Fertre, Raphael Gallais-Pou, Philippe Cornu,
	Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Mikko Perttunen, Jonathan Hunter, Alexey Brodkin, Dave Stevenson,
	Maíra Canal, Raspberry Pi Kernel Maintenance,
	Jonathan Corbet
  Cc: linux-aspeed, dri-devel, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-amlogic, imx, linux-rockchip, linux-stm32,
	linux-tegra, linux-doc, Anusha Srivatsa, Dmitry Baryshkov

Start replacing the below occurences with the newer API:
- (devm_)platform_get_resource + devm_ioremap_resource
- (devm_)platform_get_resource + (devm_)ioremap
- platform_get_resource_byname + devm_ioremap
Move all these occurences to uses devm_platform_ioremap_resource
instead.

Address a TODO item in the GPU section.

Used Coccinelle to make the code changes.Semantic patch:

//First Case
//rule s/platform_get_resource + devm_ioremap_resource/devm_platform_ioremap_resource
@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);

//Second case
//rule s/(devm_)platform_get_resource + (devm_)ioremap/devm_platform_ioremap_resource.
@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);

//Third case
//rule s/(devm_)platform_get_resource_byname + (devm_)ioremap/devm_platform_ioremap_resource_byname.
@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);

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
---
Anusha Srivatsa (14):
      drm/aspeed: move to devm_platform_ioremap_resource() usage
      drm/fsl-dcu: move to devm_platform_ioremap_resource() usage
      drm/hisilicon: move to devm_platform_ioremap_resource() usage
      drm/mediatek: move to devm_platform_ioremap_resource() usage
      drm/meson: move to devm_platform_ioremap_resource() usage
      drm/mxsfb: move to devm_platform_ioremap_resource() usage
      drm/rockchip: move to devm_platform_ioremap_resource() usage
      drm/sprd: move to devm_platform_ioremap_resource() usage
      drm/sti: move to devm_platform_ioremap_resource() usage
      drm/stm: move to devm_platform_ioremap_resource() usage
      drm/tegra: move to devm_platform_ioremap_resource() usage
      drm/tiny: move to devm_platform_ioremap_resource() usage
      drm/vc4: move to devm_platform_ioremap_resource() usage
      Documentation: Update the todo

 Documentation/gpu/todo.rst                      | 15 ---------------
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c         |  4 +---
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       |  4 +---
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c    |  4 +---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  4 +---
 drivers/gpu/drm/mediatek/mtk_disp_color.c       |  4 +---
 drivers/gpu/drm/mediatek/mtk_disp_gamma.c       |  4 +---
 drivers/gpu/drm/mediatek/mtk_disp_merge.c       |  4 +---
 drivers/gpu/drm/mediatek/mtk_disp_ovl.c         |  4 +---
 drivers/gpu/drm/mediatek/mtk_disp_rdma.c        |  4 +---
 drivers/gpu/drm/mediatek/mtk_dsi.c              |  4 +---
 drivers/gpu/drm/mediatek/mtk_hdmi.c             |  4 +---
 drivers/gpu/drm/mediatek/mtk_mdp_rdma.c         |  4 +---
 drivers/gpu/drm/meson/meson_drv.c               |  9 +--------
 drivers/gpu/drm/mxsfb/lcdif_drv.c               |  4 +---
 drivers/gpu/drm/mxsfb/mxsfb_drv.c               |  4 +---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     |  4 +---
 drivers/gpu/drm/sprd/sprd_dpu.c                 |  9 +--------
 drivers/gpu/drm/sprd/sprd_dsi.c                 |  9 +--------
 drivers/gpu/drm/sti/sti_compositor.c            | 10 +---------
 drivers/gpu/drm/sti/sti_dvo.c                   | 10 +---------
 drivers/gpu/drm/sti/sti_hda.c                   | 10 +---------
 drivers/gpu/drm/sti/sti_hdmi.c                  | 11 +----------
 drivers/gpu/drm/sti/sti_hqvdp.c                 | 10 +---------
 drivers/gpu/drm/sti/sti_tvout.c                 | 10 +---------
 drivers/gpu/drm/sti/sti_vtg.c                   | 10 +---------
 drivers/gpu/drm/stm/ltdc.c                      |  4 +---
 drivers/gpu/drm/tegra/dsi.c                     |  4 +---
 drivers/gpu/drm/tiny/arcpgu.c                   |  4 +---
 drivers/gpu/drm/vc4/vc4_hdmi.c                  |  9 ++-------
 30 files changed, 30 insertions(+), 164 deletions(-)
---
base-commit: c4b9570cfb63501638db720f3bee9f6dfd044b82
change-id: 20250128-cocci-memory-api-266e13a057e7

Best regards,
-- 
Anusha Srivatsa <asrivats@redhat.com>


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2025-01-31 12:53 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-28 22:29 [PATCH 00/14] drm: Move to using devm_platform_ioremap_resource Anusha Srivatsa
2025-01-28 22:29 ` [PATCH 01/14] drm/aspeed: move to devm_platform_ioremap_resource() usage Anusha Srivatsa
2025-01-28 23:48   ` Andrew Jeffery
2025-01-29 15:31   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 02/14] drm/fsl-dcu: " Anusha Srivatsa
2025-01-29 15:31   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 03/14] drm/hisilicon: " Anusha Srivatsa
2025-01-29 15:33   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 04/14] drm/mediatek: " Anusha Srivatsa
2025-01-28 22:29 ` [PATCH 05/14] drm/meson: " Anusha Srivatsa
2025-01-29 15:40   ` Maxime Ripard
2025-01-29 15:43     ` Neil Armstrong
2025-01-28 22:29 ` [PATCH 06/14] drm/mxsfb: " Anusha Srivatsa
2025-01-29 15:40   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 07/14] drm/rockchip: " Anusha Srivatsa
2025-01-29 15:41   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 08/14] drm/sprd: " Anusha Srivatsa
2025-01-28 22:29 ` [PATCH 09/14] drm/sti: " Anusha Srivatsa
2025-01-29  9:01   ` Raphael Gallais-Pou
     [not found]     ` <CAN9Xe3TKnt26G_+Lfn53j-CHxhjOqzSJ+Q6Xwx47oBtCJO6cQg@mail.gmail.com>
2025-01-31 12:45       ` Raphael Gallais-Pou
2025-01-28 22:29 ` [PATCH 10/14] drm/stm: " Anusha Srivatsa
2025-01-29  8:47   ` Raphael Gallais-Pou
2025-01-28 22:29 ` [PATCH 11/14] drm/tegra: " Anusha Srivatsa
2025-01-29 15:43   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 12/14] drm/tiny: " Anusha Srivatsa
2025-01-29 15:29   ` Maxime Ripard
2025-01-28 22:29 ` [PATCH 13/14] drm/vc4: " Anusha Srivatsa
2025-01-29 13:17   ` Dave Stevenson
2025-01-28 22:29 ` [PATCH 14/14] Documentation: Update the todo Anusha Srivatsa
2025-01-29 13:06   ` Thomas Zimmermann
2025-01-29 14:31     ` Maxime Ripard
2025-01-29 14:41       ` Thierry Reding
2025-01-29 15:28         ` Maxime Ripard
2025-01-29 16:30           ` Thierry Reding
2025-01-31 12:52       ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox