diff options
author | Michael Chan <mchan@broadcom.com> | 2012-12-06 05:33:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-07 12:44:02 -0500 |
commit | 4bd9b0fffb193d2e288f67f81821af32df8d4349 (patch) | |
tree | b2e19d3ffeac16974eda2d396f543a1d25466f1c /drivers/net/ethernet/broadcom/cnic.c | |
parent | 68c64d2034faa0961ad4a38b915dc10a4581bb64 (diff) |
cnic, bnx2x, bnx2: Simplify cnic probing.
Instead of using symbol_get(), cnic can now directly call the cnic_probe
functions in struct bnx2x and struct bnx2. symbol_get() is not reliable
as it fails when the module is still initializing.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/cnic.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/cnic.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index b8650939a4be..df8c30d1a52c 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <net/ip6_checksum.h> | 40 | #include <net/ip6_checksum.h> |
41 | #include <scsi/iscsi_if.h> | 41 | #include <scsi/iscsi_if.h> |
42 | 42 | ||
43 | #define BCM_CNIC 1 | ||
43 | #include "cnic_if.h" | 44 | #include "cnic_if.h" |
44 | #include "bnx2.h" | 45 | #include "bnx2.h" |
45 | #include "bnx2x/bnx2x.h" | 46 | #include "bnx2x/bnx2x.h" |
@@ -5449,14 +5450,12 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev) | |||
5449 | struct pci_dev *pdev; | 5450 | struct pci_dev *pdev; |
5450 | struct cnic_dev *cdev; | 5451 | struct cnic_dev *cdev; |
5451 | struct cnic_local *cp; | 5452 | struct cnic_local *cp; |
5453 | struct bnx2 *bp = netdev_priv(dev); | ||
5452 | struct cnic_eth_dev *ethdev = NULL; | 5454 | struct cnic_eth_dev *ethdev = NULL; |
5453 | struct cnic_eth_dev *(*probe)(struct net_device *) = NULL; | ||
5454 | 5455 | ||
5455 | probe = symbol_get(bnx2_cnic_probe); | 5456 | if (bp->cnic_probe) |
5456 | if (probe) { | 5457 | ethdev = (bp->cnic_probe)(dev); |
5457 | ethdev = (*probe)(dev); | 5458 | |
5458 | symbol_put(bnx2_cnic_probe); | ||
5459 | } | ||
5460 | if (!ethdev) | 5459 | if (!ethdev) |
5461 | return NULL; | 5460 | return NULL; |
5462 | 5461 | ||
@@ -5511,14 +5510,12 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev) | |||
5511 | struct pci_dev *pdev; | 5510 | struct pci_dev *pdev; |
5512 | struct cnic_dev *cdev; | 5511 | struct cnic_dev *cdev; |
5513 | struct cnic_local *cp; | 5512 | struct cnic_local *cp; |
5513 | struct bnx2x *bp = netdev_priv(dev); | ||
5514 | struct cnic_eth_dev *ethdev = NULL; | 5514 | struct cnic_eth_dev *ethdev = NULL; |
5515 | struct cnic_eth_dev *(*probe)(struct net_device *) = NULL; | ||
5516 | 5515 | ||
5517 | probe = symbol_get(bnx2x_cnic_probe); | 5516 | if (bp->cnic_probe) |
5518 | if (probe) { | 5517 | ethdev = bp->cnic_probe(dev); |
5519 | ethdev = (*probe)(dev); | 5518 | |
5520 | symbol_put(bnx2x_cnic_probe); | ||
5521 | } | ||
5522 | if (!ethdev) | 5519 | if (!ethdev) |
5523 | return NULL; | 5520 | return NULL; |
5524 | 5521 | ||