Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: al: Use devm_platform_ioremap_resource_byname
@ 2025-04-03  7:48 shao.mingyin
  2025-04-03 19:57 ` kernel test robot
  2025-04-04  6:07 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: shao.mingyin @ 2025-04-03  7:48 UTC (permalink / raw)
  To: jonnyc
  Cc: lpieralisi, kw, manivannan.sadhasivam, robh, bhelgaas, linux-pci,
	linux-kernel, yang.yang29, xu.xin16, ye.xingchen

From: Xie Ludan <xie.ludan@zte.com.cn>

Introduce devm_platform_ioremap_resource_byname() to simplify
resource retrieval and mapping.This new function consolidates
platform_get_resource_byname() and devm_ioremap_resource() into a single
call, improving code readability and reducing API call overhead.

Signed-off-by: Xie Ludan <xie.ludan@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/pci/controller/dwc/pcie-al.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-al.c b/drivers/pci/controller/dwc/pcie-al.c
index 643115f74092..f0613d442578 100644
--- a/drivers/pci/controller/dwc/pcie-al.c
+++ b/drivers/pci/controller/dwc/pcie-al.c
@@ -353,9 +353,7 @@ static int al_pcie_probe(struct platform_device *pdev)
 	}
 	al_pcie->ecam_size = resource_size(ecam_res);

-	controller_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-						      "controller");
-	al_pcie->controller_base = devm_ioremap_resource(dev, controller_res);
+	al_pcie->controller_base = devm_platform_ioremap_resource_byname(pdev, "controller");
 	if (IS_ERR(al_pcie->controller_base)) {
 		dev_err(dev, "couldn't remap controller base %pR\n",
 			controller_res);
-- 
2.25.1

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

end of thread, other threads:[~2025-04-04  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  7:48 [PATCH] PCI: al: Use devm_platform_ioremap_resource_byname shao.mingyin
2025-04-03 19:57 ` kernel test robot
2025-04-04  6:07 ` Krzysztof Kozlowski

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