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: <20240820123707.1788370-1-ruanjinjie@huawei.com>
Date: Tue, 20 Aug 2024 20:37:07 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: <broonie@...nel.org>, <mcoquelin.stm32@...il.com>,
	<alexandre.torgue@...s.st.com>, <linux-spi@...r.kernel.org>,
	<linux-stm32@...md-mailman.stormreply.com>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next] spi: stm32-qspi: Simpify resource lookup

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.

Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
---
 drivers/spi/spi-stm32-qspi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 955c920c4b63..46081df73cb0 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -780,15 +780,13 @@ static int stm32_qspi_probe(struct platform_device *pdev)
 	qspi = spi_controller_get_devdata(ctrl);
 	qspi->ctrl = ctrl;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi");
-	qspi->io_base = devm_ioremap_resource(dev, res);
+	qspi->io_base = devm_platform_ioremap_resource_byname(pdev, "qspi");
 	if (IS_ERR(qspi->io_base))
 		return PTR_ERR(qspi->io_base);
 
 	qspi->phys_base = res->start;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mm");
-	qspi->mm_base = devm_ioremap_resource(dev, res);
+	qspi->mm_base = devm_platform_ioremap_resource_byname(pdev, "qspi_mm");
 	if (IS_ERR(qspi->mm_base))
 		return PTR_ERR(qspi->mm_base);
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ