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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230705122644.32236-5-frank.li@vivo.com>
Date:   Wed,  5 Jul 2023 20:26:43 +0800
From:   Yangtao Li <frank.li@...o.com>
To:     Krzysztof Halasa <khalasa@...p.pl>
Cc:     Yangtao Li <frank.li@...o.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 5/6] soc: ixp4xx/qmgr:Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@...o.com>
---
 drivers/soc/ixp4xx/ixp4xx-qmgr.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
index 291086bb9313..8d24f39ac326 100644
--- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c
+++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
@@ -377,23 +377,19 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
 	int i, err;
 	irq_handler_t handler1, handler2;
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	int irq1, irq2;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-	qmgr_regs = devm_ioremap_resource(dev, res);
+	qmgr_regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(qmgr_regs))
 		return PTR_ERR(qmgr_regs);
 
 	irq1 = platform_get_irq(pdev, 0);
-	if (irq1 <= 0)
-		return irq1 ? irq1 : -EINVAL;
+	if (irq1 < 0)
+		return irq1;
 	qmgr_irq_1 = irq1;
 	irq2 = platform_get_irq(pdev, 1);
-	if (irq2 <= 0)
-		return irq2 ? irq2 : -EINVAL;
+	if (irq2 < 0)
+		return irq2;
 	qmgr_irq_2 = irq2;
 
 	/* reset qmgr registers */
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ