]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 693fc0d14334859430733ab902adac182fdd8153 Mon Sep 17 00:00:00 2001 |
2 | From: Eilon Greenstein <eilong@broadcom.com> | |
3 | Date: Wed, 14 Jan 2009 06:43:52 +0000 | |
4 | Subject: bnx2x: Handling probe failures | |
5 | Acked-by: Karsten Keil <kkeil@novell.com> | |
6 | Reference: bnc#472500 | |
7 | ||
8 | Failures in the probe not handled correctly - separate the flow to handle | |
9 | ||
10 | different failures | |
11 | ||
12 | Signed-off-by: Eilon Greenstein <eilong@broadcom.com> | |
13 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
14 | --- | |
15 | drivers/net/bnx2x_main.c | 12 +++++------- | |
16 | 1 files changed, 5 insertions(+), 7 deletions(-) | |
17 | ||
18 | Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
19 | =================================================================== | |
20 | --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c | |
21 | +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
22 | @@ -10272,17 +10272,15 @@ static int __devinit bnx2x_init_one(stru | |
23 | return rc; | |
24 | } | |
25 | ||
26 | - rc = register_netdev(dev); | |
27 | - if (rc) { | |
28 | - dev_err(&pdev->dev, "Cannot register net device\n"); | |
29 | - goto init_one_exit; | |
30 | - } | |
31 | - | |
32 | pci_set_drvdata(pdev, dev); | |
33 | ||
34 | rc = bnx2x_init_bp(bp); | |
35 | + if (rc) | |
36 | + goto init_one_exit; | |
37 | + | |
38 | + rc = register_netdev(dev); | |
39 | if (rc) { | |
40 | - unregister_netdev(dev); | |
41 | + dev_err(&pdev->dev, "Cannot register net device\n"); | |
42 | goto init_one_exit; | |
43 | } | |
44 |