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: <20221025031236.1031330-1-yangyingliang@huawei.com>
Date:   Tue, 25 Oct 2022 11:12:35 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <netdev@...r.kernel.org>
CC:     <davem@...emloft.net>, <kuba@...nel.org>
Subject: [PATCH net-next 1/2] net: natsemi: xtsonic: switch to use platform_get_irq()

Switch to use platform_get_irq() which supports more cases.

Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/net/ethernet/natsemi/xtsonic.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/natsemi/xtsonic.c b/drivers/net/ethernet/natsemi/xtsonic.c
index 52fef34d43f9..ffb3814c54cb 100644
--- a/drivers/net/ethernet/natsemi/xtsonic.c
+++ b/drivers/net/ethernet/natsemi/xtsonic.c
@@ -201,14 +201,17 @@ int xtsonic_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
 	struct sonic_local *lp;
-	struct resource *resmem, *resirq;
+	struct resource *resmem;
+	int irq;
 	int err = 0;
 
 	if ((resmem = platform_get_resource(pdev, IORESOURCE_MEM, 0)) == NULL)
 		return -ENODEV;
 
-	if ((resirq = platform_get_resource(pdev, IORESOURCE_IRQ, 0)) == NULL)
-		return -ENODEV;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
+
 
 	if ((dev = alloc_etherdev(sizeof(struct sonic_local))) == NULL)
 		return -ENOMEM;
@@ -219,7 +222,7 @@ int xtsonic_probe(struct platform_device *pdev)
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
 	dev->base_addr = resmem->start;
-	dev->irq = resirq->start;
+	dev->irq = irq;
 
 	if ((err = sonic_probe1(dev)))
 		goto out;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ