ar71xx: boost SPI flash read performance
[openwrt.git] / target / linux / lantiq / patches-3.2 / 0021-NET-MIPS-lantiq-return-value-of-request_irq-was-not-.patch
1 From 6916ef9742e45213d524b69700d937976098d1e6 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Tue, 15 Nov 2011 15:56:06 +0100
4 Subject: [PATCH 21/70] NET: MIPS: lantiq: return value of request_irq was not
5 handled gracefully
6
7 The return values of request_irq() were not checked leading to the following
8 error message.
9
10 drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_hw_init':
11 drivers/net/ethernet/lantiq_etop.c:368:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result
12 drivers/net/ethernet/lantiq_etop.c:377:15: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result
13
14 Signed-off-by: John Crispin <blogic@openwrt.org>
15 Cc: netdev@vger.kernel.org
16 ---
17 drivers/net/ethernet/lantiq_etop.c | 14 ++++++++------
18 1 files changed, 8 insertions(+), 6 deletions(-)
19
20 diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
21 index 9fd6779..dddb9fe 100644
22 --- a/drivers/net/ethernet/lantiq_etop.c
23 +++ b/drivers/net/ethernet/lantiq_etop.c
24 @@ -312,6 +312,7 @@ ltq_etop_hw_init(struct net_device *dev)
25 {
26 struct ltq_etop_priv *priv = netdev_priv(dev);
27 unsigned int mii_mode = priv->pldata->mii_mode;
28 + int err = 0;
29 int i;
30
31 ltq_pmu_enable(PMU_PPE);
32 @@ -356,7 +357,7 @@ ltq_etop_hw_init(struct net_device *dev)
33
34 ltq_dma_init_port(DMA_PORT_ETOP);
35
36 - for (i = 0; i < MAX_DMA_CHAN; i++) {
37 + for (i = 0; i < MAX_DMA_CHAN && !err; i++) {
38 int irq = LTQ_DMA_ETOP + i;
39 struct ltq_etop_chan *ch = &priv->ch[i];
40
41 @@ -364,21 +365,22 @@ ltq_etop_hw_init(struct net_device *dev)
42
43 if (IS_TX(i)) {
44 ltq_dma_alloc_tx(&ch->dma);
45 - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
46 + err = request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
47 "etop_tx", priv);
48 } else if (IS_RX(i)) {
49 ltq_dma_alloc_rx(&ch->dma);
50 for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
51 ch->dma.desc++)
52 if (ltq_etop_alloc_skb(ch))
53 - return -ENOMEM;
54 + err = -ENOMEM;
55 ch->dma.desc = 0;
56 - request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
57 + err = request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
58 "etop_rx", priv);
59 }
60 - ch->dma.irq = irq;
61 + if (!err)
62 + ch->dma.irq = irq;
63 }
64 - return 0;
65 + return err;
66 }
67
68 static void
69 --
70 1.7.7.1
71
This page took 0.042593 seconds and 5 git commands to generate.