lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <da6af483-5ee9-45cd-922e-d9d5364674dc@web.de>
Date: Mon, 5 Feb 2024 15:23:18 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
 linux-pm@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Angelo Gioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 Geert Uytterhoeven <geert+renesas@...der.be>, Heiko Stübner
 <heiko@...ech.de>, Jernej Skrabec <jernej.skrabec@...il.com>,
 Matthias Brugger <matthias.bgg@...il.com>, Rob Herring <robh@...nel.org>,
 Ulf Hansson <ulf.hansson@...aro.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] pmdomain: mediatek: Use
 devm_platform_get_and_ioremap_resource() in init_scp()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 5 Feb 2024 15:08:27 +0100

A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
("drivers: provide devm_platform_get_and_ioremap_resource()").
Thus reuse existing functionality instead of keeping duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/pmdomain/mediatek/mtk-scpsys.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pmdomain/mediatek/mtk-scpsys.c b/drivers/pmdomain/mediatek/mtk-scpsys.c
index b374d01fdac7..9e7f0771e7e4 100644
--- a/drivers/pmdomain/mediatek/mtk-scpsys.c
+++ b/drivers/pmdomain/mediatek/mtk-scpsys.c
@@ -441,8 +441,7 @@ static struct scp *init_scp(struct platform_device *pdev,

 	scp->dev = &pdev->dev;

-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	scp->base = devm_ioremap_resource(&pdev->dev, res);
+	scp->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(scp->base))
 		return ERR_CAST(scp->base);

--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ