diff options
author | Michael Chan <mchan@broadcom.com> | 2012-12-06 14:33:12 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-07 21:44:02 +0400 |
commit | 4bd9b0fffb193d2e288f67f81821af32df8d4349 (patch) | |
tree | b2e19d3ffeac16974eda2d396f543a1d25466f1c /drivers/net/ethernet/broadcom/cnic.c | |
parent | 68c64d2034faa0961ad4a38b915dc10a4581bb64 (diff) | |
download | linux-4bd9b0fffb193d2e288f67f81821af32df8d4349.tar.xz |
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 @@ #include <net/ip6_checksum.h> #include <scsi/iscsi_if.h> +#define BCM_CNIC 1 #include "cnic_if.h" #include "bnx2.h" #include "bnx2x/bnx2x.h" @@ -5449,14 +5450,12 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev) struct pci_dev *pdev; struct cnic_dev *cdev; struct cnic_local *cp; + struct bnx2 *bp = netdev_priv(dev); struct cnic_eth_dev *ethdev = NULL; - struct cnic_eth_dev *(*probe)(struct net_device *) = NULL; - probe = symbol_get(bnx2_cnic_probe); - if (probe) { - ethdev = (*probe)(dev); - symbol_put(bnx2_cnic_probe); - } + if (bp->cnic_probe) + ethdev = (bp->cnic_probe)(dev); + if (!ethdev) return NULL; @@ -5511,14 +5510,12 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev) struct pci_dev *pdev; struct cnic_dev *cdev; struct cnic_local *cp; + struct bnx2x *bp = netdev_priv(dev); struct cnic_eth_dev *ethdev = NULL; - struct cnic_eth_dev *(*probe)(struct net_device *) = NULL; - probe = symbol_get(bnx2x_cnic_probe); - if (probe) { - ethdev = (*probe)(dev); - symbol_put(bnx2x_cnic_probe); - } + if (bp->cnic_probe) + ethdev = bp->cnic_probe(dev); + if (!ethdev) return NULL; |