From patchwork Tue Feb 6 16:34:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 197537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1663274dyb; Tue, 6 Feb 2024 08:37:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJQ29PRD8IiBh4iJ1GbqWJWxUnk1/GQiV/cPdDd/TPSgRWi4Cd7HmC7WCNGNqgERf+YtEk X-Received: by 2002:a05:6870:5252:b0:219:ba6e:c130 with SMTP id o18-20020a056870525200b00219ba6ec130mr1527556oai.9.1707237421546; Tue, 06 Feb 2024 08:37:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707237421; cv=pass; d=google.com; s=arc-20160816; b=PfHTmMGR15kEyGzrTEX5FeeK6/S87ftAsSYG+cwgj4QY4xwn5jVAeYIacjH6t8J5Ka n7OpLcybAPmjijEXzN9GZgov/ViEJTlEvijqXQM33m8dTrfO8VSO5OOZczl+qt7NlU64 9ugHH6hzdVLm6zDAGpIlPCw8ipVZePNdPJjDqGD/oUFJii8wzztYd4OFSyJALr6dFkoN wKnjTHU288AW223wzLDqhzJbm8+7jNKbad9mlvljEld2JkyfKnC1yItxRTRSBfHW0pC0 2aNYRtpw7oGubhw6L7woOj++Pf+UM2nTwUojvDi4Ma18l3vTgKu73pe6nJ9knm/3/RyX AhHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=Edtzb0KMuajvkJi/GAoIPNP+qPCLeoAf0Rggt+fRYJE=; fh=1k6U9luCmpytZPNPU+O+yqZgpnMIf7UDb0lsKWG5DnE=; b=pYI7NVS+9lKARscrj2VmuSQVKD6n64vW8/fbhgcFK7KXxeh6gwyHeJQjU0rHEN/HAb q24M4GzPmXTEekTCwgRpTy9tfMsM81aSp5PlBjPLbvFm/yq2T0wvY8vxrWHZtK+LMr2h fU7sIB4H35qNZxF7+l0NAxCtF/dLV2TSpkN3gsmqpeTy5SsI+Rpg7Y8xXiPNCwfu+TFN +d5nGRWGqK5MsieqgtOL8aw5zlJFvnSIZEnRozkwM34fYf5i06PnQoyoYNedoUBkKwme eleggBQOGhL83RfvYpRIy9ZL0BWm1lYNsIa+ZO/8k0ESQnnzCBBSwhQ35WzPxvf5C9p2 vfQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=wm2GeNKk; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-55324-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55324-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de X-Forwarded-Encrypted: i=1; AJvYcCVZbBCV7s27j4rs8LPZfIhqzrSObaGiYtQZdjZOhYT6n5E5b4EYdmjjmzGdezLJDHEOkNWnu05ecqxzuJMFDRLQkFEcXg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d10-20020a63f24a000000b005cef24b3015si1851705pgk.219.2024.02.06.08.37.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 08:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55324-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=wm2GeNKk; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-55324-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55324-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4DD9D2868ED for ; Tue, 6 Feb 2024 16:37:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECC8D1078B; Tue, 6 Feb 2024 16:35:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="wm2GeNKk" Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1342E552; Tue, 6 Feb 2024 16:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707237332; cv=none; b=Sl1aPlLkxJUBEnbrUgJQ3Mu+cNE3xKAAWihXtL9zVBZuZ9dlWGINhXvDh9blYE5eP0Rtp5RhfkvTyueKdPIosKYAX6Xu+SE8x8s/OEgWJqaWL7ZtTV1xo/UATFSVBuFTrL2E06N9Ms6LyUZmOQNu2A+MMfqkFQqB05sohZjrzKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707237332; c=relaxed/simple; bh=JM/dM6wGVgOsNpN99AnBS8S4uISuXxo9JPeocMSYoto=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=MxR1dU0V5ONRhVWkbh7oht/w5skTXHyWapXWRS663eYotNq8knsLFqwXFvbxgEMEzl7HyN9/amsVeVGw4vLKSLoXpJ/IqA8o+nv8SkwJTfss6/k1BjISby6tpZ1Ab5BQ2etsJPsdZLUkjnIiBiosALR/8oQjUMeIDqnrr4i04x8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=wm2GeNKk; arc=none smtp.client-ip=212.227.15.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1707237302; x=1707842102; i=markus.elfring@web.de; bh=JM/dM6wGVgOsNpN99AnBS8S4uISuXxo9JPeocMSYoto=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=wm2GeNKkzOndkNz/FtcaFa4S9HHjec3kDslAkK3GraBiGHrAmC00TncNVhbeqBDk dI1i1sB69oHbVdYiHHSchrj9LrCVHAbTbNNk7nWefWQQkT2dHDB4cSNsZZLVRejnR y0TgGNQb3ZPou/oJ6mfKrKpU1cWirhDQhv4tL3qtjEMuOns6zeHCmeknH2GyPEeah qkIufCXsWWFi9+uQzCmj+a40Kba5FHwRvlbDV+NSkKCYvFwBEvn5/phnclWvdjtZb 0dZt3Yd7WDZt/0zjDefOQ1i7mic/Yiyi1GzIqZ/hZcFA+tRk5EHp496fzC7c0mVa+ XOVult7M7Rlgdp1nqw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MbCI8-1r0WVC29Yu-00bZlD; Tue, 06 Feb 2024 17:35:02 +0100 Message-ID: <6e6ce5f8-b701-4660-a71b-478b29197a21@web.de> Date: Tue, 6 Feb 2024 17:34:59 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2] EDAC/xgene: Use devm_platform_ioremap_resource() in xgene_edac_probe() Content-Language: en-GB From: Markus Elfring To: linux-edac@vger.kernel.org, kernel-janitors@vger.kernel.org, Borislav Petkov , James Morse , Khuong Dinh , Mauro Carvalho Chehab , Robert Richter , Tony Luck Cc: LKML References: <0b255d17-deab-4d6e-bf44-d950b512dc14@web.de> In-Reply-To: <0b255d17-deab-4d6e-bf44-d950b512dc14@web.de> X-Provags-ID: V03:K1:hVEeAHWZkLBabGliku9TpAcPPUlMuNPVJGnTqc1ncndDJaWdiqz YkXhK1xHsPme+wPdYtE5z5VFxNbLpIa6lUSqXKzTxukevtlGSwPDKU8GaJfbE4+xK1ilUm9 l4QodqIrM8Pc9YiHhoVkzkywvzjFktTpCw/HSRW9OGmg24lFh70VVurOGHjPrY4UYqLmLk+ bgoWGL8r+og8Qow6uBrAQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:oJf/jY8IscE=;Q+dSKDZhB+CRZBgbdhZB6FGd8+h lZ4qQNrVgZ+UFYwLfo7r4KNrViFvHZE0po8IlJ5SFcT62UUivK3MYd1LPpkyY1MtsvKNfLxHi yEY8GM8dJro0FmRJJW4DwmWYcLciEVnVjlhgahgKZTCTgeS1hM7J773mBZuxJtNGzPlvqnEWM 8xIrbvQm+I5qJU3QPCxy/YiDlkToKOH3ZPeKPYk/9BGQ1GXUhXYD9+ODA99S+lAjj88ZD8s9O 78rzvWfPPFm5EKr4NUsttFqZ3tzM2x6Og+jwMs939+OV1MEQC0+BEeCKKQJYilh42i0KfM6Gk dwvqk53uqmXWcMURgq1xYrUPeeOEczS3UOwdb0i7VQE83bfFYz/OTpOQ8TuhyWmvGGjfzTxYa D4fkVJTKt7oR3INknULpqlrn9lGJYcHpaqiNqh8m4Dx4SqUPVrtoQD03VXVWS6keBhs+alSC+ DSnn4PJ/9jyH1Cypg9DK39u9f3M9h+M1uSvWfhEqpTh4V22G3LPIcDxT1yOfG1CrDn4e5HG/+ hKdDw2um0ilxPMG4y+9hcLTno6kxW30c8xrtT5wl5Srd57hDagJX9HmNQTNchh1CZ4rOr3uFK OImKxLGnDdR5MRaRbCxMKm4UvkNUnjL4xlQP2+3Rbe63tq+3bQZqKo6Luo5Jb3J3PCK/I2Fly Pr0pNEpiR9hM7QUOwyfJC0mYx25qcqMkPJAZkwl009TIzwh1x4to/MgsFjwyEt19aaZCTKy++ z1HSWt3Ipakixy8V3vYm+sKPXxemyCebs56anaIa5OR13Yr90lAs/RVGSneZNPoiSgC2wfyjy M9h7ere6ST0hrdNh5w2+vM9H4GRFiToE9adw0RSiXKdjs= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790168186556081074 X-GMAIL-MSGID: 1790168186556081074 From: Markus Elfring Date: Tue, 6 Feb 2024 17:30:11 +0100 A wrapper function is available since the commit 7945f929f1a77a1c8887a97ca07f87626858ff42 ("drivers: provide devm_platform_ioremap_resource()"). * Thus reuse existing functionality instead of keeping duplicate source code. * Delete a local variable which became unnecessary with this refactoring. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: The transformation pattern was adjusted based on advices by known contributors. Examples: * Doug Anderson * Geert Uytterhoeven * Robin Murphy drivers/edac/xgene_edac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.43.0 diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c index 1b50f8160013..59eb0e97adef 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);