diff options
author | Vasundhara Volam <vasundhara.volam@emulex.com> | 2014-09-02 00:26:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-02 15:46:00 -0400 |
commit | c5f156def02bffe41bb6c931302c074d00465354 (patch) | |
tree | 2c12cb3a5ca98473e22d2e79804ea7cd30505770 | |
parent | 0d3f5ccec907bcfb4f5d4941d762dc2f89b2d24d (diff) |
be2net: make be_cmd_get_regs() return a status
There are a few failure cases in be_cmd_get_regs() that ideally must return
an error value. This style is used across all the routines in be_cmds.c with
this routine being an exception. This patch fixes this.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index ca9ec181d807..5be100d1bc0a 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -1681,17 +1681,17 @@ err: | |||
1681 | return status; | 1681 | return status; |
1682 | } | 1682 | } |
1683 | 1683 | ||
1684 | void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) | 1684 | int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) |
1685 | { | 1685 | { |
1686 | struct be_dma_mem get_fat_cmd; | 1686 | struct be_dma_mem get_fat_cmd; |
1687 | struct be_mcc_wrb *wrb; | 1687 | struct be_mcc_wrb *wrb; |
1688 | struct be_cmd_req_get_fat *req; | 1688 | struct be_cmd_req_get_fat *req; |
1689 | u32 offset = 0, total_size, buf_size, | 1689 | u32 offset = 0, total_size, buf_size, |
1690 | log_offset = sizeof(u32), payload_len; | 1690 | log_offset = sizeof(u32), payload_len; |
1691 | int status; | 1691 | int status = 0; |
1692 | 1692 | ||
1693 | if (buf_len == 0) | 1693 | if (buf_len == 0) |
1694 | return; | 1694 | return -EIO; |
1695 | 1695 | ||
1696 | total_size = buf_len; | 1696 | total_size = buf_len; |
1697 | 1697 | ||
@@ -1700,10 +1700,9 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) | |||
1700 | get_fat_cmd.size, | 1700 | get_fat_cmd.size, |
1701 | &get_fat_cmd.dma); | 1701 | &get_fat_cmd.dma); |
1702 | if (!get_fat_cmd.va) { | 1702 | if (!get_fat_cmd.va) { |
1703 | status = -ENOMEM; | ||
1704 | dev_err(&adapter->pdev->dev, | 1703 | dev_err(&adapter->pdev->dev, |
1705 | "Memory allocation failure while retrieving FAT data\n"); | 1704 | "Memory allocation failure while retrieving FAT data\n"); |
1706 | return; | 1705 | return -ENOMEM; |
1707 | } | 1706 | } |
1708 | 1707 | ||
1709 | spin_lock_bh(&adapter->mcc_lock); | 1708 | spin_lock_bh(&adapter->mcc_lock); |
@@ -1746,6 +1745,7 @@ err: | |||
1746 | pci_free_consistent(adapter->pdev, get_fat_cmd.size, | 1745 | pci_free_consistent(adapter->pdev, get_fat_cmd.size, |
1747 | get_fat_cmd.va, get_fat_cmd.dma); | 1746 | get_fat_cmd.va, get_fat_cmd.dma); |
1748 | spin_unlock_bh(&adapter->mcc_lock); | 1747 | spin_unlock_bh(&adapter->mcc_lock); |
1748 | return status; | ||
1749 | } | 1749 | } |
1750 | 1750 | ||
1751 | /* Uses synchronous mcc */ | 1751 | /* Uses synchronous mcc */ |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index 5284b825bba2..0e1186856aa6 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
@@ -2101,7 +2101,7 @@ int be_cmd_get_die_temperature(struct be_adapter *adapter); | |||
2101 | int be_cmd_get_cntl_attributes(struct be_adapter *adapter); | 2101 | int be_cmd_get_cntl_attributes(struct be_adapter *adapter); |
2102 | int be_cmd_req_native_mode(struct be_adapter *adapter); | 2102 | int be_cmd_req_native_mode(struct be_adapter *adapter); |
2103 | int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size); | 2103 | int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size); |
2104 | void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf); | 2104 | int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf); |
2105 | int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege, | 2105 | int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege, |
2106 | u32 domain); | 2106 | u32 domain); |
2107 | int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges, | 2107 | int be_cmd_set_fn_privileges(struct be_adapter *adapter, u32 privileges, |