Commit 36e90a52 authored by Nikita Danilov's avatar Nikita Danilov Committed by David S. Miller

net: atlantic: simplify hw_get_fw_version() usage

hw_get_fw_version() never fails, so this patch simplifies its
usage by utilizing return value instead of output argument.
Signed-off-by: default avatarNikita Danilov <ndanilov@marvell.com>
Signed-off-by: default avatarMark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 099d074e
...@@ -259,7 +259,7 @@ struct aq_hw_ops { ...@@ -259,7 +259,7 @@ struct aq_hw_ops {
struct aq_stats_s *(*hw_get_hw_stats)(struct aq_hw_s *self); struct aq_stats_s *(*hw_get_hw_stats)(struct aq_hw_s *self);
int (*hw_get_fw_version)(struct aq_hw_s *self, u32 *fw_version); u32 (*hw_get_fw_version)(struct aq_hw_s *self);
int (*hw_set_offload)(struct aq_hw_s *self, int (*hw_set_offload)(struct aq_hw_s *self,
struct aq_nic_cfg_s *aq_nic_cfg); struct aq_nic_cfg_s *aq_nic_cfg);
......
...@@ -1032,11 +1032,7 @@ struct aq_nic_cfg_s *aq_nic_get_cfg(struct aq_nic_s *self) ...@@ -1032,11 +1032,7 @@ struct aq_nic_cfg_s *aq_nic_get_cfg(struct aq_nic_s *self)
u32 aq_nic_get_fw_version(struct aq_nic_s *self) u32 aq_nic_get_fw_version(struct aq_nic_s *self)
{ {
u32 fw_version = 0U; return self->aq_hw_ops->hw_get_fw_version(self->aq_hw);
self->aq_hw_ops->hw_get_fw_version(self->aq_hw, &fw_version);
return fw_version;
} }
int aq_nic_set_loopback(struct aq_nic_s *self) int aq_nic_set_loopback(struct aq_nic_s *self)
......
...@@ -70,7 +70,7 @@ int hw_atl_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops) ...@@ -70,7 +70,7 @@ int hw_atl_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops)
hw_atl_utils_hw_chip_features_init(self, hw_atl_utils_hw_chip_features_init(self,
&self->chip_features); &self->chip_features);
hw_atl_utils_get_fw_version(self, &self->fw_ver_actual); self->fw_ver_actual = hw_atl_utils_get_fw_version(self);
if (hw_atl_utils_ver_match(HW_ATL_FW_VER_1X, if (hw_atl_utils_ver_match(HW_ATL_FW_VER_1X,
self->fw_ver_actual) == 0) { self->fw_ver_actual) == 0) {
...@@ -915,11 +915,9 @@ int hw_atl_utils_hw_get_regs(struct aq_hw_s *self, ...@@ -915,11 +915,9 @@ int hw_atl_utils_hw_get_regs(struct aq_hw_s *self,
return 0; return 0;
} }
int hw_atl_utils_get_fw_version(struct aq_hw_s *self, u32 *fw_version) u32 hw_atl_utils_get_fw_version(struct aq_hw_s *self)
{ {
*fw_version = aq_hw_read_reg(self, 0x18U); return aq_hw_read_reg(self, HW_ATL_MPI_FW_VERSION);
return 0;
} }
static int aq_fw1x_set_wake_magic(struct aq_hw_s *self, bool wol_enabled, static int aq_fw1x_set_wake_magic(struct aq_hw_s *self, bool wol_enabled,
......
...@@ -622,7 +622,7 @@ int hw_atl_utils_hw_set_power(struct aq_hw_s *self, ...@@ -622,7 +622,7 @@ int hw_atl_utils_hw_set_power(struct aq_hw_s *self,
int hw_atl_utils_hw_deinit(struct aq_hw_s *self); int hw_atl_utils_hw_deinit(struct aq_hw_s *self);
int hw_atl_utils_get_fw_version(struct aq_hw_s *self, u32 *fw_version); u32 hw_atl_utils_get_fw_version(struct aq_hw_s *self);
int hw_atl_utils_update_stats(struct aq_hw_s *self); int hw_atl_utils_update_stats(struct aq_hw_s *self);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment