mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: "Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Rosen Penev" <rosenp@gmail.com>,
	"Breno Leitao" <leitao@debian.org>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next 12/12] net: ibm: emac: mal: move irq maps down
Date: Wed, 30 Oct 2024 13:37:27 -0700	[thread overview]
Message-ID: <20241030203727.6039-13-rosenp@gmail.com> (raw)
In-Reply-To: <20241030203727.6039-1-rosenp@gmail.com>

Moves the handling right before they are used and allows merging a
branch.

Also get rid of the error handling as devm_request_irq can handle that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/ibm/emac/mal.c | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index db9faac21317..7d70056e9008 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -579,25 +579,6 @@ static int mal_probe(struct platform_device *ofdev)
 #endif
 	}
 
-	mal->txeob_irq = platform_get_irq(ofdev, 0);
-	mal->rxeob_irq = platform_get_irq(ofdev, 1);
-	mal->serr_irq = platform_get_irq(ofdev, 2);
-
-	if (mal_has_feature(mal, MAL_FTR_COMMON_ERR_INT)) {
-		mal->txde_irq = mal->rxde_irq = mal->serr_irq;
-	} else {
-		mal->txde_irq = platform_get_irq(ofdev, 3);
-		mal->rxde_irq = platform_get_irq(ofdev, 4);
-	}
-
-	if (mal->txeob_irq < 0 || mal->rxeob_irq < 0 || mal->serr_irq < 0 ||
-	    mal->txde_irq < 0 || mal->rxde_irq < 0) {
-		printk(KERN_ERR
-		       "mal%d: failed to map interrupts !\n", index);
-		err = -ENODEV;
-		goto fail_unmap;
-	}
-
 	INIT_LIST_HEAD(&mal->poll_list);
 	INIT_LIST_HEAD(&mal->list);
 	spin_lock_init(&mal->lock);
@@ -651,10 +632,17 @@ static int mal_probe(struct platform_device *ofdev)
 			     sizeof(struct mal_descriptor) *
 			     mal_rx_bd_offset(mal, i));
 
+	mal->txeob_irq = platform_get_irq(ofdev, 0);
+	mal->rxeob_irq = platform_get_irq(ofdev, 1);
+	mal->serr_irq = platform_get_irq(ofdev, 2);
+
 	if (mal_has_feature(mal, MAL_FTR_COMMON_ERR_INT)) {
+		mal->txde_irq = mal->rxde_irq = mal->serr_irq;
 		irqflags = IRQF_SHARED;
 		hdlr_serr = hdlr_txde = hdlr_rxde = mal_int;
 	} else {
+		mal->txde_irq = platform_get_irq(ofdev, 3);
+		mal->rxde_irq = platform_get_irq(ofdev, 4);
 		irqflags = 0;
 		hdlr_serr = mal_serr;
 		hdlr_txde = mal_txde;
-- 
2.47.0


  parent reply	other threads:[~2024-10-30 20:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 20:37 [PATCH net-next 00/12] ibm: emac: cleanup modules to use devm Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 01/12] net: ibm: emac: tah: use devm for kzalloc Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 02/12] net: ibm: emac: tah: use devm for mutex_init Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 03/12] net: ibm: emac: tah: devm_platform_get_resources Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 04/12] net: ibm: emac: rgmii: use devm for kzalloc Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 05/12] net: ibm: emac: rgmii: use devm for mutex_init Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 06/12] net: ibm: emac: rgmii: devm_platform_get_resource Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 07/12] net: ibm: emac: zmii: use devm for kzalloc Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 08/12] net: ibm: emac: zmii: use devm for mutex_init Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 09/12] net: ibm: emac: zmii: devm_platform_get_resource Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 10/12] net: ibm: emac: mal: use devm for kzalloc Rosen Penev
2024-10-30 20:37 ` [PATCH net-next 11/12] net: ibm: emac: mal: use devm for request_irq Rosen Penev
2024-10-30 20:37 ` Rosen Penev [this message]
2024-11-03 22:50 ` [PATCH net-next 00/12] ibm: emac: cleanup modules to use devm patchwork-bot+netdevbpf

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=20241030203727.6039-13-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=u.kleine-koenig@baylibre.com \
    /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

all inboxes | Powered by JetHome®