Commit cc4d3de9 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: Remove resource query check

Since SwitchX-2 support was removed in commit b0d80c01 ("mlxsw:
Remove Mellanox SwitchX-2 ASIC support"), all the ASICs supported by
mlxsw support the resource query command.

Therefore, remove the resource query check and always query resources
from the device.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 902992d1
...@@ -2078,7 +2078,6 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -2078,7 +2078,6 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
const char *device_kind = mlxsw_bus_info->device_kind; const char *device_kind = mlxsw_bus_info->device_kind;
struct mlxsw_core *mlxsw_core; struct mlxsw_core *mlxsw_core;
struct mlxsw_driver *mlxsw_driver; struct mlxsw_driver *mlxsw_driver;
struct mlxsw_res *res;
size_t alloc_size; size_t alloc_size;
int err; int err;
...@@ -2104,8 +2103,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info, ...@@ -2104,8 +2103,8 @@ __mlxsw_core_bus_device_register(const struct mlxsw_bus_info *mlxsw_bus_info,
mlxsw_core->bus_priv = bus_priv; mlxsw_core->bus_priv = bus_priv;
mlxsw_core->bus_info = mlxsw_bus_info; mlxsw_core->bus_info = mlxsw_bus_info;
res = mlxsw_driver->res_query_enabled ? &mlxsw_core->res : NULL; err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile,
err = mlxsw_bus->init(bus_priv, mlxsw_core, mlxsw_driver->profile, res); &mlxsw_core->res);
if (err) if (err)
goto err_bus_init; goto err_bus_init;
...@@ -3240,9 +3239,6 @@ int mlxsw_core_resources_query(struct mlxsw_core *mlxsw_core, char *mbox, ...@@ -3240,9 +3239,6 @@ int mlxsw_core_resources_query(struct mlxsw_core *mlxsw_core, char *mbox,
u16 id; u16 id;
int err; int err;
if (!res)
return 0;
mlxsw_cmd_mbox_zero(mbox); mlxsw_cmd_mbox_zero(mbox);
for (index = 0; index < MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES; for (index = 0; index < MLXSW_CMD_QUERY_RESOURCES_MAX_QUERIES;
......
...@@ -402,7 +402,6 @@ struct mlxsw_driver { ...@@ -402,7 +402,6 @@ struct mlxsw_driver {
u8 txhdr_len; u8 txhdr_len;
const struct mlxsw_config_profile *profile; const struct mlxsw_config_profile *profile;
bool res_query_enabled;
}; };
int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
......
...@@ -461,7 +461,6 @@ static struct mlxsw_driver mlxsw_m_driver = { ...@@ -461,7 +461,6 @@ static struct mlxsw_driver mlxsw_m_driver = {
.init = mlxsw_m_init, .init = mlxsw_m_init,
.fini = mlxsw_m_fini, .fini = mlxsw_m_fini,
.profile = &mlxsw_m_config_profile, .profile = &mlxsw_m_config_profile,
.res_query_enabled = true,
}; };
static const struct i2c_device_id mlxsw_m_i2c_id[] = { static const struct i2c_device_id mlxsw_m_i2c_id[] = {
......
...@@ -3627,7 +3627,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = { ...@@ -3627,7 +3627,6 @@ static struct mlxsw_driver mlxsw_sp1_driver = {
.ptp_transmitted = mlxsw_sp_ptp_transmitted, .ptp_transmitted = mlxsw_sp_ptp_transmitted,
.txhdr_len = MLXSW_TXHDR_LEN, .txhdr_len = MLXSW_TXHDR_LEN,
.profile = &mlxsw_sp1_config_profile, .profile = &mlxsw_sp1_config_profile,
.res_query_enabled = true,
}; };
static struct mlxsw_driver mlxsw_sp2_driver = { static struct mlxsw_driver mlxsw_sp2_driver = {
...@@ -3665,7 +3664,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = { ...@@ -3665,7 +3664,6 @@ static struct mlxsw_driver mlxsw_sp2_driver = {
.ptp_transmitted = mlxsw_sp_ptp_transmitted, .ptp_transmitted = mlxsw_sp_ptp_transmitted,
.txhdr_len = MLXSW_TXHDR_LEN, .txhdr_len = MLXSW_TXHDR_LEN,
.profile = &mlxsw_sp2_config_profile, .profile = &mlxsw_sp2_config_profile,
.res_query_enabled = true,
}; };
static struct mlxsw_driver mlxsw_sp3_driver = { static struct mlxsw_driver mlxsw_sp3_driver = {
...@@ -3703,7 +3701,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = { ...@@ -3703,7 +3701,6 @@ static struct mlxsw_driver mlxsw_sp3_driver = {
.ptp_transmitted = mlxsw_sp_ptp_transmitted, .ptp_transmitted = mlxsw_sp_ptp_transmitted,
.txhdr_len = MLXSW_TXHDR_LEN, .txhdr_len = MLXSW_TXHDR_LEN,
.profile = &mlxsw_sp2_config_profile, .profile = &mlxsw_sp2_config_profile,
.res_query_enabled = true,
}; };
static struct mlxsw_driver mlxsw_sp4_driver = { static struct mlxsw_driver mlxsw_sp4_driver = {
...@@ -3739,7 +3736,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = { ...@@ -3739,7 +3736,6 @@ static struct mlxsw_driver mlxsw_sp4_driver = {
.ptp_transmitted = mlxsw_sp_ptp_transmitted, .ptp_transmitted = mlxsw_sp_ptp_transmitted,
.txhdr_len = MLXSW_TXHDR_LEN, .txhdr_len = MLXSW_TXHDR_LEN,
.profile = &mlxsw_sp2_config_profile, .profile = &mlxsw_sp2_config_profile,
.res_query_enabled = true,
}; };
bool mlxsw_sp_port_dev_check(const struct net_device *dev) bool mlxsw_sp_port_dev_check(const struct net_device *dev)
......
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