From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: netdev@vger.kernel.org
Cc: "David Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org, "Shawn Guo" <shawn.guo@linaro.org>,
"Lothar Waßmann" <LW@KARO-electronics.de>
Subject: [PATCH v3 4/8] net/fec: don't request invalid IRQ
Date: Thu, 8 Dec 2011 08:59:28 +0100 [thread overview]
Message-ID: <6d1e5cdcbfc48df864ec9e0939645c0e95389d2a.1323326019.git.LW@KARO-electronics.de> (raw)
In-Reply-To: <0b92136d69e509a6ce49b526e1834f0ec90b04a4.1323326019.git.LW@KARO-electronics.de>
In-Reply-To: <cover.1323326019.git.LW@KARO-electronics.de>
prevent calling request_irq() with a known invalid IRQ number and
preserve the return value of the platform_get_irq() function
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 7ef408f..e2b5ce6 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1575,8 +1575,12 @@ fec_probe(struct platform_device *pdev)
for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i);
- if (i && irq < 0)
- break;
+ if (irq < 0) {
+ if (i)
+ break;
+ ret = irq;
+ goto failed_irq;
+ }
ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
if (ret) {
while (--i >= 0) {
--
1.5.6.5
next prev parent reply other threads:[~2011-12-08 7:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 7:59 [PATCH v3 0/8] net/fec: several cleanups and bugfixes Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 1/8] net/fec: misc cleanups Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 2/8] net/fec: set con_id in clk_get() call to NULL Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 3/8] net/fec: prevent dobule restart of interface on FDX/HDX change Lothar Waßmann
2011-12-08 7:59 ` Lothar Waßmann [this message]
2011-12-08 7:59 ` [PATCH v3 5/8] net/fec: don't munge MAC address from platform data Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 6/8] net/fec: preserve MII/RMII setting in fec_stop() Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 7/8] net/fec: fix the .remove code Lothar Waßmann
2011-12-08 7:59 ` [PATCH v3 8/8] net/fec: make FEC driver buildable as module Lothar Waßmann
2011-12-09 0:54 ` [PATCH v3 0/8] net/fec: several cleanups and bugfixes David Miller
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=6d1e5cdcbfc48df864ec9e0939645c0e95389d2a.1323326019.git.LW@KARO-electronics.de \
--to=lw@karo-electronics.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shawn.guo@linaro.org \
/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®