aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/gianfar.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index b5bb7ae2817f..64b201134fdb 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -161,7 +161,7 @@ static int gfar_probe(struct platform_device *pdev)
161 struct gfar_private *priv = NULL; 161 struct gfar_private *priv = NULL;
162 struct gianfar_platform_data *einfo; 162 struct gianfar_platform_data *einfo;
163 struct resource *r; 163 struct resource *r;
164 int err = 0; 164 int err = 0, irq;
165 DECLARE_MAC_BUF(mac); 165 DECLARE_MAC_BUF(mac);
166 166
167 einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; 167 einfo = (struct gianfar_platform_data *) pdev->dev.platform_data;
@@ -187,15 +187,25 @@ static int gfar_probe(struct platform_device *pdev)
187 187
188 /* fill out IRQ fields */ 188 /* fill out IRQ fields */
189 if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { 189 if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
190 priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); 190 irq = platform_get_irq_byname(pdev, "tx");
191 priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); 191 if (irq < 0)
192 priv->interruptError = platform_get_irq_byname(pdev, "error"); 192 goto regs_fail;
193 if (priv->interruptTransmit < 0 || priv->interruptReceive < 0 || priv->interruptError < 0) 193 priv->interruptTransmit = irq;
194
195 irq = platform_get_irq_byname(pdev, "rx");
196 if (irq < 0)
197 goto regs_fail;
198 priv->interruptReceive = irq;
199
200 irq = platform_get_irq_byname(pdev, "error");
201 if (irq < 0)
194 goto regs_fail; 202 goto regs_fail;
203 priv->interruptError = irq;
195 } else { 204 } else {
196 priv->interruptTransmit = platform_get_irq(pdev, 0); 205 irq = platform_get_irq(pdev, 0);
197 if (priv->interruptTransmit < 0) 206 if (irq < 0)
198 goto regs_fail; 207 goto regs_fail;
208 priv->interruptTransmit = irq;
199 } 209 }
200 210
201 /* get a pointer to the register memory */ 211 /* get a pointer to the register memory */