diff options
author | Manish Chopra <manish.chopra@qlogic.com> | 2013-05-30 09:51:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-30 16:52:37 -0700 |
commit | b08a92bb7381ff03d4101bcc61e65120bc690a4f (patch) | |
tree | fd3b3d3ea9f2f05f30ff08171565c37d1ff0dacc /drivers/net/ethernet/qlogic/netxen/netxen_nic.h | |
parent | netxen_nic: Log driver version with firmware version (diff) | |
download | linux-dev-b08a92bb7381ff03d4101bcc61e65120bc690a4f.tar.xz linux-dev-b08a92bb7381ff03d4101bcc61e65120bc690a4f.zip |
netxen_nic: Log proper error message in case of mismatched adapter type
o log "Unknown" board name and "Unknown" serial number in case
of mismatched adapter type found. This will avoid weird characters
logs when an adapter is in bad state or corrupted.
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/netxen/netxen_nic.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h index 322a36b76727..e5ab1ecb4bb2 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic.h +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic.h @@ -1855,7 +1855,7 @@ static const struct netxen_brdinfo netxen_boards[] = { #define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards) -static inline void get_brd_name_by_type(u32 type, char *name) +static inline int netxen_nic_get_brd_name_by_type(u32 type, char *name) { int i, found = 0; for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) { @@ -1864,10 +1864,14 @@ static inline void get_brd_name_by_type(u32 type, char *name) found = 1; break; } + } + if (!found) { + strcpy(name, "Unknown"); + return -EINVAL; } - if (!found) - name = "Unknown"; + + return 0; } static inline u32 netxen_tx_avail(struct nx_host_tx_ring *tx_ring) |