[5/5] EDAC/xgene: Convert to devm_platform_ioremap_resource()

Message ID 20230704101811.49637-5-frank.li@vivo.com
State New
Headers
Series [1/5] EDAC, mellanox: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 4, 2023, 10:18 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/edac/xgene_edac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Patch

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index c52b9dd9154c..5ac1a0d3495b 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1845,7 +1845,6 @@  static int xgene_edac_probe(struct platform_device *pdev)
 {
 	struct xgene_edac *edac;
 	struct device_node *child;
-	struct resource *res;
 	int rc;
 
 	edac = devm_kzalloc(&pdev->dev, sizeof(*edac), GFP_KERNEL);
@@ -1903,8 +1902,7 @@  static int xgene_edac_probe(struct platform_device *pdev)
 		edac->rb_map = NULL;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	edac->pcp_csr = devm_ioremap_resource(&pdev->dev, res);
+	edac->pcp_csr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(edac->pcp_csr)) {
 		dev_err(&pdev->dev, "no PCP resource address\n");
 		rc = PTR_ERR(edac->pcp_csr);