Patchwork [2/2] net: ethernet: xilinx: Do not use NO_IRQ in axienet

login
register
mail settings
Submitter Michal Simek
Date Jan. 10, 2013, 4:58 p.m.
Message ID <1357837123-18996-2-git-send-email-michal.simek@xilinx.com>
Download mbox | patch
Permalink /patch/211095/
State Accepted
Delegated to: David Miller
Headers show

Comments

Michal Simek - Jan. 10, 2013, 4:58 p.m.
This driver is used on Microblaze and will be used
on Arm Zynq.
Microblaze doesn't define NO_IRQ and no IRQ is 0.
Arm still uses NO_IRQ as -1 and there is no option
to connect IRQ to irq 0.

That's why <= 0 is only one option how to find out
undefined IRQ.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Jan. 10, 2013, 10:38 p.m.
From: Michal Simek <michal.simek@xilinx.com>
Date: Thu, 10 Jan 2013 17:58:43 +0100

> This driver is used on Microblaze and will be used
> on Arm Zynq.
> Microblaze doesn't define NO_IRQ and no IRQ is 0.
> Arm still uses NO_IRQ as -1 and there is no option
> to connect IRQ to irq 0.
> 
> That's why <= 0 is only one option how to find out
> undefined IRQ.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index d9f69b8..6f47100 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1590,7 +1590,7 @@  static int axienet_of_probe(struct platform_device *op)
 	lp->rx_irq = irq_of_parse_and_map(np, 1);
 	lp->tx_irq = irq_of_parse_and_map(np, 0);
 	of_node_put(np);
-	if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
+	if ((lp->rx_irq <= 0) || (lp->tx_irq <= 0)) {
 		dev_err(&op->dev, "could not determine irqs\n");
 		ret = -ENOMEM;
 		goto err_iounmap_2;