]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NET: MIPS: Lantiq: Return value of request_irq was not handled gracefully
authorJohn Crispin <blogic@openwrt.org>
Tue, 17 Jan 2012 13:26:15 +0000 (14:26 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Apr 2012 23:26:27 +0000 (00:26 +0100)
The return values of request_irq() were not checked leading to the following
error message.

drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_hw_init':
drivers/net/ethernet/lantiq_etop.c:368:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result
drivers/net/ethernet/lantiq_etop.c:377:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result

Signed-off-by: John Crispin <blogic@openwrt.org>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3275/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/net/ethernet/lantiq_etop.c

index 9cbac81da10fd1c7211e48129b1ac2bb7649cac5..aa69c079ec0ee2116d3af6781b76c27891eac33a 100644 (file)
@@ -313,6 +313,7 @@ ltq_etop_hw_init(struct net_device *dev)
 {
        struct ltq_etop_priv *priv = netdev_priv(dev);
        unsigned int mii_mode = priv->pldata->mii_mode;
+       int err = 0;
        int i;
 
        ltq_pmu_enable(PMU_PPE);
@@ -357,7 +358,7 @@ ltq_etop_hw_init(struct net_device *dev)
 
        ltq_dma_init_port(DMA_PORT_ETOP);
 
-       for (i = 0; i < MAX_DMA_CHAN; i++) {
+       for (i = 0; i < MAX_DMA_CHAN && !err; i++) {
                int irq = LTQ_DMA_ETOP + i;
                struct ltq_etop_chan *ch = &priv->ch[i];
 
@@ -365,21 +366,25 @@ ltq_etop_hw_init(struct net_device *dev)
 
                if (IS_TX(i)) {
                        ltq_dma_alloc_tx(&ch->dma);
-                       request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
+                       err = request_irq(irq, ltq_etop_dma_irq, 0,
                                "etop_tx", priv);
                } else if (IS_RX(i)) {
                        ltq_dma_alloc_rx(&ch->dma);
                        for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
                                        ch->dma.desc++)
-                               if (ltq_etop_alloc_skb(ch))
-                                       return -ENOMEM;
+                               if (ltq_etop_alloc_skb(ch)) {
+                                       err = -ENOMEM;
+                                       goto err_out;
+                               }
                        ch->dma.desc = 0;
-                       request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
+                       err = request_irq(irq, ltq_etop_dma_irq, 0,
                                "etop_rx", priv);
                }
-               ch->dma.irq = irq;
+               if (!err)
+                       ch->dma.irq = irq;
        }
-       return 0;
+err_out:
+       return err;
 }
 
 static void