From patchwork Tue Feb 6 16:08:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 771128 Received: from mout.web.de (mout.web.de [212.227.15.14]) (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 A31C813474D; Tue, 6 Feb 2024 16:08:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707235722; cv=none; b=jtOhnsAik4NreUMajDgGuCYn3r7q5X21zgnwGN71ItrxHTR93q/oTHlksK7Vg3d2RtItnqhvD+4Cm31Ys1bOOLHAu2yaF63QMB92TnbJv1F2uWp64JjlIdENE6wGvdtDPDfWFQeGuW96a64P72r5r1QjX5LNyAwrLMVl6RfmbnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707235722; c=relaxed/simple; bh=vTxrG4v2mMuRDOPQJTUsTxo4xRJdjAEb+Gx4TOmxTdc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=NLe/rJd4+/QoWeuHLksaIW12bAKgH4h5TrJm4qHNAgHmB+Zys86Byqj7OrXBYV6ftWq+PCXA+/rQxL4xCbWSCnfgZaDU1i1j0kIe22T8dIWcy6h06vQwufLpkIwVxiNek3EapLHitd8LUKVo2xJBdmZf2Wfa1KQ6n4AhqdG+eqw= 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=qow08uAw; arc=none smtp.client-ip=212.227.15.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="qow08uAw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1707235712; x=1707840512; i=markus.elfring@web.de; bh=vTxrG4v2mMuRDOPQJTUsTxo4xRJdjAEb+Gx4TOmxTdc=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=qow08uAwuU19vDccnNrSwQm999hAa+xaJqjaRKveLz4TuaqAlPS9xDy/FntFsVhj gpHRLXkhaLsvjAl4qVEgHDGvkmfdObJD7GgrY/uuvFL0OdKVF4zA0VQwdsLjEG7l2 B1ZHGXJQTyFBJn31nLWvTOGy/vwZy9zWL9xbyk6v+zqKHGT0QOmMh16Oc/lI6rvWf DTHqfPPW7/QSvf2L3nmv43pQKNtQ/ccfTg2BGJY851jjzFjIFofDeBuXzyrsb8rRg /Z9Kp3+DVmdiNh5Ipupmk0eACCTAZzT2kT1rXuf/zPOVvOIngMInviTo78oqq95L6 oGao9Zg5yxoe/e5Sxw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MN6FV-1rH61y465N-00Ilk0; Tue, 06 Feb 2024 17:08:32 +0100 Message-ID: <59412fc9-396d-4b62-95a8-1aed3d61cd0c@web.de> Date: Tue, 6 Feb 2024 17:08:30 +0100 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH v2] bus: omap_l3_noc: Use devm_platform_ioremap_resource() in omap_l3_probe() Content-Language: en-GB From: Markus Elfring To: linux-omap@vger.kernel.org, kernel-janitors@vger.kernel.org, Tony Lindgren Cc: LKML References: <10028785-166f-4473-900a-c845cb690dc8@web.de> In-Reply-To: <10028785-166f-4473-900a-c845cb690dc8@web.de> X-Provags-ID: V03:K1:yMKkzTis1C5GrJg1MYR0yoiI0PL6rmtZvDNGLvL1U/FuGBODU6U YmaRourHQLmJJlI4TyOdG7Z5UkiNz0HHSeuslLd3I7C9QMjuiDBEEkOSJPxWxmJSrhvZKK1 ubwWVK4LkcnXp7ndwro4xC5TiQn7cn/tmr7srnfRZ3FDKg9DACDjk4zBDjpVmG6KYFhtYrs HzKIoRUk3TXQFXJF9ip0g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:CgzI+ARSy5g=;PGo8R9aGxN5wkV9x6th3wTbZxQk ajU59lUXBIyYEMOnll9JQJxGAkAH+2NeFRzzuLJMnXGsVxnfX6/fj6Qwmh9+oLUIV/VjVqLVI 5TUKr4KB1+r0eln8fVx6UXL9nIYzmfiBFyv3JF8dZiv0OvNFCQAK8bV6xNTj55JrIbBK77lPW MwMXdU5VLFFup8kzRvogISabQC+pAK2uUVUeHpo70tuKNGrlZu3XkQjVC5prYiRmr7VShYMdu llgL3FLmplraSZyKsk/5acqp4xYdS+FLbIf/Vi9Mo5cwKiDvXs0WVPBCb8sjvENIOcW71+dBN G7CKSPjhYrxhkZ0az7/MOP0vU7HuezBDsXXtFVsm3w6jAqHiGU/Ezwky5Ug8kp3urgQHhE6XT lZE4CsUXk7mGTNDEzt4nLqveOifaFWnPFH/X3zAKL9S3B+7+HbQ6Z3QTtQaMKtl8imz6k8yRn zwKRjpH/AXgNXV32IxzZ/MHm1rjnKjdd0+M3kICYWiBmqDagSaLMXVKGPnoRuabGevTlD36Xn J0t02bl5reG0V3Nbd43a/crwEvXEOnjBV+YkIWmANn9DkryvOCkm348fsub6OWID0sa7hulRW TmvhpjVoauEHUoarEGeAbCT+v0egoAakA1TovMyYFvX4F4CyLDEZhAJIgox+dcfZKzsC3Mva6 IbUeuFxWu7K4k86RGTHimJi25c6F0anAfcjClQeGdUH+KUPrHNPRsTGfXe3v8YpBdKiW6YOJu aQ+5meeXkVfDZ2WudzVLSTFLPfu9AdWwARqrF2HdUiWbfTOxYD+rVH2DI61a5qUSbCwQblcoj 7CPjb41poqYz3o0bqyGi4IQqVKui2aCHfEOxrDoy7glFA= From: Markus Elfring Date: Tue, 6 Feb 2024 17:01:25 +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/bus/omap_l3_noc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.43.0 diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c index eb1ba6319fda..f114dee4e937 100644 --- a/drivers/bus/omap_l3_noc.c +++ b/drivers/bus/omap_l3_noc.c @@ -255,16 +255,14 @@ static int omap_l3_probe(struct platform_device *pdev) /* Get mem resources */ for (i = 0, res_idx = 0; i < l3->num_modules; i++) { - struct resource *res; - if (l3->l3_base[i] == L3_BASE_IS_SUBMODULE) { /* First entry cannot be submodule */ BUG_ON(i == 0); l3->l3_base[i] = l3->l3_base[i - 1]; continue; } - res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx); - l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res); + + l3->l3_base[i] = devm_platform_ioremap_resource(pdev, res_idx); if (IS_ERR(l3->l3_base[i])) { dev_err(l3->dev, "ioremap %d failed\n", i); return PTR_ERR(l3->l3_base[i]);