stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	kuba@kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 12/12] net:mcf8390: Use platform_get_irq() to get the interrupt
Date: Wed, 16 Mar 2022 10:16:36 -0400	[thread overview]
Message-ID: <20220316141636.248324-12-sashal@kernel.org> (raw)
In-Reply-To: <20220316141636.248324-1-sashal@kernel.org>

From: "Minghao Chi (CGEL ZTE)" <chi.minghao@zte.com.cn>

[ Upstream commit 2a760554dcba450d3ad61b32375b50ed6d59a87c ]

It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ)
for requesting IRQ's resources any more, as they can be not ready yet in
case of DT-booting.

platform_get_irq() instead is a recommended way for getting IRQ even if
it was not retrieved earlier.

It also makes code simpler because we're getting "int" value right away
and no conversion from resource to int is required.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/8390/mcf8390.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/8390/mcf8390.c b/drivers/net/ethernet/8390/mcf8390.c
index 4ad8031ab669..065fdbe66c42 100644
--- a/drivers/net/ethernet/8390/mcf8390.c
+++ b/drivers/net/ethernet/8390/mcf8390.c
@@ -406,12 +406,12 @@ static int mcf8390_init(struct net_device *dev)
 static int mcf8390_probe(struct platform_device *pdev)
 {
 	struct net_device *dev;
-	struct resource *mem, *irq;
+	struct resource *mem;
 	resource_size_t msize;
-	int ret;
+	int ret, irq;
 
-	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (irq == NULL) {
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
 		dev_err(&pdev->dev, "no IRQ specified?\n");
 		return -ENXIO;
 	}
@@ -434,7 +434,7 @@ static int mcf8390_probe(struct platform_device *pdev)
 	SET_NETDEV_DEV(dev, &pdev->dev);
 	platform_set_drvdata(pdev, dev);
 
-	dev->irq = irq->start;
+	dev->irq = irq;
 	dev->base_addr = mem->start;
 
 	ret = mcf8390_init(dev);
-- 
2.34.1


      parent reply	other threads:[~2022-03-16 14:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16 14:16 [PATCH AUTOSEL 5.10 01/12] arm64: dts: qcom: c630: disable crypto due to serror Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 02/12] HID: logitech-dj: add new lightspeed receiver id Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 03/12] xfrm: fix tunnel model fragmentation behavior Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 04/12] ARM: mstar: Select HAVE_ARM_ARCH_TIMER Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 05/12] virtio_console: break out of buf poll on remove Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 06/12] vdpa/mlx5: should verify CTRL_VQ feature exists for MQ Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 07/12] Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 08/12] tools/virtio: fix virtio_test execution Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 09/12] ethernet: sun: Free the coherent when failing in probing Sasha Levin
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 10/12] gpio: Revert regression in sysfs-gpio (gpiolib.c) Sasha Levin
2022-03-16 16:06   ` Linus Walleij
2022-03-16 16:40     ` Sasha Levin
2022-03-16 23:41       ` Linus Walleij
2022-03-16 14:16 ` [PATCH AUTOSEL 5.10 11/12] spi: Fix invalid sgs value Sasha Levin
2022-03-16 14:16 ` Sasha Levin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220316141636.248324-12-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=chi.minghao@zte.com.cn \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).