Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-edac@vger.kernel.org
Cc: Khuong Dinh <khuong@os.amperecomputing.com>,
	Borislav Petkov <bp@alien8.de>, Tony Luck <tony.luck@intel.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-kernel@vger.kernel.org (open list),
	llvm@lists.linux.dev (open list:CLANG/LLVM BUILD
	SUPPORT:Keyword:\b(?i:clang|llvm)\b)
Subject: [PATCH] EDAC/xgene: use devm_platform_ioremap_resource in probe
Date: Sun, 19 Jul 2026 14:11:50 -0700	[thread overview]
Message-ID: <20260719211150.585626-1-rosenp@gmail.com> (raw)

Replace the open-coded platform_get_resource() +
devm_ioremap_resource() pair in xgene_edac_probe() with the single
helper devm_platform_ioremap_resource(), fetching the PCP CSR mapping up
front and assigning it to edac->pcp_csr after the edac context is
allocated. The redundant struct resource and the late re-ioremap are
dropped.

Built for arm64 (CONFIG_EDAC_XGENE) with LLVM=1;
drivers/edac/xgene_edac.o compiles cleanly and passes checkpatch
--strict.

Assisted-by: opencode:hy3-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/edac/xgene_edac.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index 9955396c9a52..92d1f15bdf30 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -1844,9 +1844,13 @@ static int xgene_edac_probe(struct platform_device *pdev)
 {
 	struct xgene_edac *edac;
 	struct device_node *child;
-	struct resource *res;
+	void __iomem *pcp_csr;
 	int rc;
 
+	pcp_csr = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(pcp_csr))
+		return PTR_ERR(pcp_csr);
+
 	edac = devm_kzalloc(&pdev->dev, sizeof(*edac), GFP_KERNEL);
 	if (!edac)
 		return -ENOMEM;
@@ -1902,13 +1906,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);
-	if (IS_ERR(edac->pcp_csr)) {
-		dev_err(&pdev->dev, "no PCP resource address\n");
-		rc = PTR_ERR(edac->pcp_csr);
-		goto out_err;
-	}
+	edac->pcp_csr = pcp_csr;
 
 	if (edac_op_state == EDAC_OPSTATE_INT) {
 		int irq;
-- 
2.55.0


                 reply	other threads:[~2026-07-19 21:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260719211150.585626-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=bp@alien8.de \
    --cc=justinstitt@google.com \
    --cc=khuong@os.amperecomputing.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox